dplyr ggplot plotly中的交互式绘图R
我想根据我创建的dplyr ggplot plotly中的交互式绘图R,r,ggplot2,dplyr,r-plotly,ggplotly,R,Ggplot2,Dplyr,R Plotly,Ggplotly,我想根据我创建的dplyr管道创建一个交互式图表。我不完全确定这是否可行,但如果成功的话,那将是非常令人惊讶的。 这是密码。我基本上希望有一个下拉菜单,可以根据可用的唯一选项(注释掉)过滤rxid。 如果可能的话,我想避免使用shiny,但是如果需要的话,我想可以使用shiny drugname <- c('cipro', 'moxi','tazo') lhoabx %>% #filter (rxid %in% 'drugname' ) %>% (d
dplyr
管道创建一个交互式图表。我不完全确定这是否可行,但如果成功的话,那将是非常令人惊讶的。
这是密码。我基本上希望有一个下拉菜单,可以根据可用的唯一选项(注释掉)过滤rxid
。
如果可能的话,我想避免使用shiny,但是如果需要的话,我想可以使用shiny
drugname <- c('cipro', 'moxi','tazo')
lhoabx %>%
#filter (rxid %in% 'drugname' ) %>% (drop down menu here?)
group_by (locationid, month) %>%
summarise (totaldot = sum(as.numeric(dot))) %>%
right_join(pdays.summary, by = c('locationid', 'month')) %>%
mutate (totaldot = case_when( is.na(totaldot) ~ 0
,TRUE ~ totaldot )) %>%
mutate(dot1000 = totaldot/totalpdays * 1000) %>%
ggplot (., aes(x = month, y = dot1000)) +
geom_line(aes(linetype = locationid))
drugname%
#过滤器(rxid%在%'drugname')%%>%(下拉菜单在这里?)
分组依据(地点ID,月份)%>%
汇总(总计点=总和(作为数字点))%>%
右键连接(pdays.summary,by=c('locationid','month'))%>%
当(is.na(totaldot)~0时突变(totaldot=case_
,TRUE~totaldot))%>%
突变(dot1000=totaldot/totalpdays*1000)%>%
ggplot(,aes(x=month,y=dot1000))+
几何图形线(aes(线型=位置ID))
您打算如何在不使用Shiny的情况下使图表具有交互性?是的,我想知道是否有一种方法可以在不使用Shiny的情况下实现这一点。希望与使用powerbitry的人分享这个“操纵”软件包。如果您使用plotly: