在下拉列表中选择选项后,未显示与过滤相关的条形图

时间:2019-03-30 04:27:02

标签: r flexdashboard

我正在尝试使用bsselectR库在Flex的R下拉列表中基于选择选择绘制条形图。但它没有显示任何错误,但没有绘制图形。

library(googleVis)
library(bsselectR)
library(stringr)
status =dbSendQuery(mydb,'select count(*) as bill_count, bs.status,pbi.service_date
from patient_bill_info pbi
inner join emedadminmaster.bill_status bs on bs.status_code = pbi.sent_to_billing
where pbi.sent_to_billing!="c" and pbi.service_date >="2018-01-01" and pbi.service_date<="2019-01-31"
group by pbi.sent_to_billing;')




bsselect(year, type = "img", selected = "Oregon", 
         live_search = TRUE, show_tick = TRUE)


y21 =dbSendQuery(mydb,'select bs.status,count(*) as bill_count, bs.status,pbi.service_date
                        from patient_bill_info pbi inner join emedadminmaster.bill_status bs on bs.status_code = pbi.sent_to_billing
                        where pbi.sent_to_billing!="c" and pbi.service_date >="2018-01-01" and pbi.service_date<="2019-01-31"
                        group by pbi.sent_to_billing;')

      y=fetch(y21,n=-1)
      print(y)
      y211<-y[grep(year,y$status,ignore.case = T),]
      print(y211)
      y20<-data.frame(y211$status,y211$bill_count)
      print(y20)
      print(str(na.omit(y20)))
      y20piechart<- gvisAreaChart(y20)


提前谢谢!

0 个答案:

没有答案