我正在尝试加载数据集,它在本地应用程序上工作正常,但是当我发布它时出现错误。
server.R
library('DT')
shinyServer(function(input, output) {
output$distPlot <- renderDT({bar1 <- readRDS("./Data/cohortData.RDA") })
})
ui.r
library(DT)
# Define UI for application that draws a histogram
bar1 <- readRDS("./Data/cohortData.RDA")
shinyUI(fluidPage(
# Application title
titlePanel("Cohort Analysis Nisnass"),
# Sidebar with a slider input for number of bins
# Show a plot of the generated distribution
DTOutput("distPlot")
))
日志
Listening on http://127.0.0.1:35544
2019-01-24T00:01:23.013253+00:00 shinyapps[658838]:
2019-01-24T00:01:23.013256+00:00 shinyapps[658838]: Attaching package: ‘DT’
2019-01-24T00:01:23.013257+00:00 shinyapps[658838]:
2019-01-24T00:01:23.014163+00:00 shinyapps[658838]: The following objects are masked from ‘package:shiny’:
2019-01-24T00:01:23.014165+00:00 shinyapps[658838]:
2019-01-24T00:01:23.014165+00:00 shinyapps[658838]: dataTableOutput, renderDataTable
2019-01-24T00:01:23.014166+00:00 shinyapps[658838]:
2019-01-24T00:01:27.230207+00:00 shinyapps[658838]: Warning: Error in value[[3L]]: Couldn't normalize path in `addResourcePath`, with arguments: `prefix` = 'dt-core-1.10.16'; `directoryPath` = '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/DT/htmlwidgets/lib/datatables'
更新
数据表代码
m<-DT::datatable(cohorts.wide,
class = 'cell-border stripe',
rownames = FALSE,
options = list(
ordering=F,
dom = 't',
pageLength = 12) ) %>%
formatStyle("0",
backgroundColor = 'lightgrey',
fontWeight = 'bold') %>%
formatStyle(names(cohorts.wide[c(-1,-2)]),fontWeight = 'bold',color = 'white', backgroundColor = styleInterval(breaks,colors))