我试图调整一个plotOutputui对象的光泽
library(shiny)
ui <- fluidPage(
fluidRow(
column(6, numericInput('save.height', "Save height (mm)", value = 50)),
column(6, numericInput('save.width', "Save width (mm)", value = 43))),
plotOutput('plot_display', width = '50mm', height = '43mm'))
server <- function(input, output) {
output$plot_display <- renderPlot({
ggplot(iris, aes(x = Species, y = Petal.Length)) +
stat_summary(geom = 'bar', fun.y = mean) +
geom_point() +
theme(aspect.ratio = 1)
})
}
shinyApp(ui, server)
Run Code Online (Sandbox Code Playgroud)
我无法找到相当于updateNumericInput()动态更新值的东西plotOutput
你也可以使用很棒的shinyjqui包:
library(shiny)
library(shinyjqui)
shinyApp(
ui = fluidPage(
jqui_resizabled(plotOutput('hist'))
),
server = function(input, output) {
output$hist <- renderPlot({
hist(rnorm(100))
})
}
)
Run Code Online (Sandbox Code Playgroud)
见这里:https://github.com/Yang-Tang/shinyjqui.
