r - 基于 SelectiveInput R Shiny 渲染箱线图
问题描述
我正在尝试通过选择性输入在 R 中渲染一些箱线图。我有我的选择,但是当我运行应用程序时,它只是说找不到对象并且不会渲染。这是我的 ui 代码,plotoutput 是“boxplot”:
selectInput(inputId = "Input3", "Boxplot:",
choices = c(label = NULL,
'Gunning Fog Index'= 'gfi',
'Percentage of hard words'= 'pohw',
'Flesch Readability Ease' = 'flesch',
'Automated Readability Index' = 'ari',
'Percentage of first person pronouns' = 'pofpp',
'Percentage of third person pronouns' = 'potpp')),
这是我的服务器代码:
output$boxplot <- renderPlot({
par(mfrow=c(1, 2))
# generate bins based on input$bins from ui.R
boxplot(get(input$Input3), Flesch_fake, ylim = c(-20, 60), col = "red", main="Flesch Reading Ease - Fake")
})
如果我尝试在 renderPlot 函数中的 Input3 之后使用 $flesch,则表示该运算符对原子向量无效。我怎样才能解决这个问题,只需通过 SelectiveInput 渲染一个箱线图?该应用程序本身可以工作,只是不会呈现箱线图。
解决方案
推荐阅读
- javascript - Chart.JS - 在时间图中设置固定的 X 和 Y 轴值?
- reactjs - 我们是否可以选择为 React 路由实现键盘快捷键
- python - 在 bqplt/jupyter 中使用多个滑块创建动态图表
- r - sidebarMenu 未存储正确的值
- python-3.x - 源代码被打包在 python 轮子中
- elasticsearch - 在 Elasticsearch 中批量插入对象
- javascript - 发布自定义 HANDLER URL reCAPTCHA
- c# - 在 GridView c# 中按名称而不是编号调用单元格
- google-cloud-platform - 需要了解谷歌云中的访客指标
- java - Fragment 中 NestedScrollView 中的文本与我第二次打开 Fragment 重叠。第一次它工作正常