I used brilliant for several small projects, and now I'm trying to make a shinydashboard package that looks pretty promising. I also want to integrate the interactive plot using plotly (although other libraries may be considered in the future).
I have no problems with running examples that integrate the plot into brilliant ( example ), but I encounter problems when trying to achieve similar results using shinydashboard.
For example, the code below (app.R) does not work correctly.
library(shiny)
library(shinydashboard)
library(plotly)
library(ggplot2)
data(movies, package = "ggplot2")
minx <- min(movies$rating)
maxx <- max(movies$rating)
ui <- dashboardPage(
dashboardHeader(title = "Test"),
dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard"))
)
),
dashboardBody(
fluidRow(
box(plotOutput("plot1"), width=6, height=500),
box(plotOutput("plot2"), width=6, height=500)
)
)
)
server <- function(input, output, session) {
output$plot1 <- renderPlot({
p <- plot_ly(movies, x = rating, autobinx = F, type = "histogram",
xbins = list(start = minx, end = maxx, size = 2))
layout(p, xaxis = list(title = "Ratings", range = c(minx, maxx), autorange = F,
autotick = F, tick0 = minx, dtick = 2))
})
output$plot2 <- renderPlot({
hist(movies$rating, col="blue")
})
}
shinyApp(ui, server)
, : , R. , Rstudio. runApp(), - , - .
( , ), , , /.
, , , ( ), , , .
, ( , ). ?