【发布时间】:2018-09-11 10:44:08
【问题描述】:
在 Rmarkdown 中生成 flexdashboard,我想导入一个 excel 工作表并使用 selectInput 语句从中选择 2、3、4、5 列(product1、product2、product3、product4)中的任何一个excel表并绘制column1(Day)与selectInput语句(product1或product2或product3或product4)中选定列的散点图。有人可以帮我写 R 代码吗?enter image description here
--- 标题:“一般情节” 作者:“Aravind” 日期:“April 1st,2018” 输出: flexdashboard::flex_dashboard: 方向:列
运行时:闪亮
{r, echo=FALSE} library(readxl) library(flexdashboard) library(shiny) library(plotly) data_to_plot<-read_excel("random.xlsx")输入 {.sidebar}{r Global Filter Panel, echo=FALSE} selectInput("Product","Activity",choices=c('product1','product2','product3','product4'),selected=NULL,width = '400px')在这个标签下会显示图表图表 {.tabsets .tabset-fade}
图表```{r echo=FALSE, message=FALSE}
renderPlotly(
p% layout(title="使用R plotly散点图", xaxis=list(title="Day"),yaxis=list(title="Product"), 图例=列表(x=1,y=0.5))%>% p)```
【问题讨论】:
-
向我们展示您迄今为止的尝试。您的代码尝试在哪里?你在哪里卡住了?有很多可用的教程/资源可以帮助您入门。 SO 不是免费的代码编写服务。你需要表现出一些努力!也请在 SO 上查看how to ask 问题。
-
嗨 Maurits,我是 SO 新手,感谢您的建议。
-
我已经在描述中包含了我迄今为止尝试过的代码。请让我知道我在哪里犯了错误或者我应该如何处理它。
标签: r shiny r-markdown flexdashboard