给定的脚本在两个框中生成一个简单的直方图和一个滑块。我希望减少两个框之间的空间,以及它们与屏幕末端的极端边界之间的空间。请帮助和感谢。地块快照
## app.R ##
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(title = "Basic dashboard"),
dashboardSidebar(
width = 0
),
dashboardBody(
# Boxes need to be put in a row (or column)
fluidRow(
box(title = "Activity Frequency", status = "primary",height = "520",
solidHeader = T,
plotOutput("plot1")),
box(title = "Activity Frequency", status = "primary",height = "520",
solidHeader = T,
sliderInput("slider", "Number of observations:", 1, 100, 50))
)
)
)
server <- function(input, output) {
set.seed(122)
histdata <- rnorm(500)
output$plot1 <- renderPlot({
data <- histdata[seq_len(input$slider)]
hist(data)
})
}
shinyApp(ui, server)