R语言 如何使网格内闪亮

5kgi1eie  于 2024-01-03  发布在  其他
关注(0)|答案(1)|浏览(103)

似乎即使包含renderTrelliscope功能,也无法在shiny中使用Trelliscope。你们中的任何人可以帮助我确认这一点吗?
虽然这些链接似乎有帮助:https://www.rdocumentation.org/packages/trelliscopejs/versions/0.1.18/topics/Trelliscope-shiny
一个问题,但不能帮助我https://github.com/hafen/trelliscopejs/issues/37

library(shiny)
install.packages("gapminder")
library(gapminder)
devtools::install_github("hafen/trelliscopejs")
library(trelliscopejs)
ui <- fluidPage(

  # App title ----
  titlePanel("Hello trelliscope in Shiny!"),

  # Sidebar layout with input and output definitions ----
  fluidPage(

    # Main panel for displaying outputs ----
    mainPanel(

      # Output: Histogram ----
      trelliscopeOutput("plot", width = "100%", height = "400px")

    )
  )
)

server <- function(input, output) {

  output$plot <- renderTrelliscope(
    qplot(year, lifeExp, data = gapminder) +
      xlim(1948, 2011) + ylim(10, 95) + theme_bw() +
      facet_trelliscope(~ country + continent,
                        nrow = 2, ncol = 7, width = 300, as_plotly = TRUE)

    )
  }

shinyApp(ui, server)

字符串
我们如何在shiny中渲染facet_treliscope?

bwleehnv

bwleehnv1#

有一个新的trelliscope R包,并有关于如何嵌入到Shiny应用程序的文档:https://trelliscope.org/trelliscope/articles/embed.html

相关问题