闪亮的应用程序-Choropleth映射-Covid19-数据范围-选择输入

问题描述

我想用r做一个闪亮的应用程序。 我的目标是制作一张意大利的迭代地图(choroplet),在其中输入日期范围并选择感兴趣的变量(在文件中报告-重症监护,家庭隔离,总阳性等)。

这里是我的代码,请帮助我:

enter code here

library(flexdashboard)
library(magrittr)

italy_region <- read.csv("https://raw.githubusercontent.com/RamiKrispin/covid19Italy/master/csv/italy_region.csv",stringsAsFactors = FALSE)
italy_region$date <- as.Date(italy_region$date)

italy_total <- read.csv("https://raw.githubusercontent.com/RamiKrispin/covid19Italy/master/csv/italy_total.csv",stringsAsFactors = FALSE)
italy_total$date <- as.Date(italy_total$date)



italy_map_region <- rnaturalearth::ne_states(country = "Italy",returnclass = "sf") %>%
  dplyr::select(province = name,region,geometry) %>%
  dplyr::group_by(region) %>%
  dplyr::summarise(n = dplyr::n()) %>%
  dplyr::left_join(italy_region %>% 
                     dplyr::filter(date == max(date)) %>%
                     dplyr::group_by(region_spatial) %>%
                     dplyr::summarise(cumulative_cases = sum(cumulative_cases)),# subseting for the most recent day
                   by = c("region" = "region_spatial"))



  ### Total Number of Cases by Region (as of `r max(italy_region$date)`)

italy_map_region %>% 
  mapview::mapview(zcol = "cumulative_cases") #%>%
# leaflet::setView(lng =  12.49,lat = 41.9,zoom = 14)


解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)