我想知道为什么在以下代码中找不到Species列:
```{r echo=FALSE}
inputPanel(
selectInput("s", label = "Species:",
choices = unique(iris$Species))
)
renderPlot({
iris.dt <- data.table(iris)
ggplot(iris.dt[Species == input$s], aes(Sepal.Length, Sepal.Width)) + geom_point()
})
应该怎么写?
修改
Output created: C:/Users/xxxxx/AppData/Local/Temp/Rtmp0Af32S/file243c5299469.html
Warning: Error in [.data.frame: object 'Species' not found
Stack trace (innermost first):
105: [.data.frame
104: [.data.table
103: [
102: ggplot
101: renderPlot [<text>#8]
91: <reactive:plotObj>
80: plotObj
79: origRenderFunc
78: output$out6967b1458d9fe4b5
3: <Anonymous>
2: do.call
1: rmarkdown::run
我使用Windows 7,Shiny 1.0.3,Rmarkdown 1.5,data.table 1.10.4,R 3.4.0,ggplot 2.2.1。