【发布时间】:2015-10-16 13:21:56
【问题描述】:
我能够在renderPlot 和ggplot 中成功绘制我的图表,但是将nPlot 用于rCharts,我收到一个错误代码:
Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs) :
need finite 'ylim' values
我只包含了我知道很麻烦的代码: 我的 ui.R:
mainPanel(
showOutput("plot3", "nvd3")
))
我的服务器.R
output$plot3 <- renderChart({
candySelect<- input$candy
d <- candyData[candyData$candy== candySelect, ]
p3 <- nPlot(freq~purchase_month, data = d ,group = "candy", type = "lineChart")
p3$addParams(dom = 'plot3')
p3
})
注意:freq 和 purchase_month 是我的数据集中的列。 purchase_month 的格式如“2014/04”。
【问题讨论】:
-
请检查您的
input$值是否为空 -
我可以这样做吗:
d[!is.na(d)]? -
你应该检查
is.null(input$candy)默认他们设置为NULL -
好的,我应该删除它们吗
is.null返回TRUE?