Dengue Data Hub
  • About
  • denguedatahub Installation
  • All Countries
  • Sri Lanka
  • USA
  • Singapore
  • China
  • Other Countries
  • Web Scraping Functions
  • Data Manipulation Functions
  • Interactive Data Explorer
  • Collaborate with us

On this page

  • Annual Dengue Cases from 2005 to 2020
    • Visualize china_annual_data
  • Applications

China

Annual Dengue Cases from 2005 to 2020

library(denguedatahub)
library(tsibble)
china_annual_data
# A tibble: 16 × 5
    year dengue.cases.indigenous dengue.cases.imported counties.with.dengue.fe…¹
   <int>                   <dbl>                 <dbl>                     <dbl>
 1  2005                       0                    45                         0
 2  2006                    1007                    46                        15
 3  2007                     481                    56                        13
 4  2008                      86                   134                        11
 5  2009                     200                    73                         5
 6  2010                     112                   119                        14
 7  2011                      35                   113                         6
 8  2012                     438                   149                        14
 9  2013                    4263                   460                        36
10  2014                   46034                   399                       160
11  2015                    3044                  1083                        44
12  2016                    1549                   675                        41
13  2017                    4609                  2112                        76
14  2018                    3801                  1266                       100
15  2019                   15378                  5813                       266
16  2020                     616                   158                         7
# ℹ abbreviated name: ¹​counties.with.dengue.fever.indigenous
# ℹ 1 more variable: counties.with.dengue.fever.imported <dbl>

Visualize china_annual_data

visdat::vis_dat(china_annual_data)

Applications

library(tidyverse)
library(magrittr)
library(plotly)

data <- china_annual_data %>% pivot_longer(cols=2:5, names_to = c("type"), values_to = c("count"))
data                                           
# A tibble: 64 × 3
    year type                                  count
   <int> <chr>                                 <dbl>
 1  2005 dengue.cases.indigenous                   0
 2  2005 dengue.cases.imported                    45
 3  2005 counties.with.dengue.fever.indigenous     0
 4  2005 counties.with.dengue.fever.imported      33
 5  2006 dengue.cases.indigenous                1007
 6  2006 dengue.cases.imported                    46
 7  2006 counties.with.dengue.fever.indigenous    15
 8  2006 counties.with.dengue.fever.imported      33
 9  2007 dengue.cases.indigenous                 481
10  2007 dengue.cases.imported                    56
# ℹ 54 more rows
p1 <- ggplot(data, aes(x=year, y=count, group=type)) +
  geom_line(aes(col=type)) + geom_point(aes(col=type)) +
  scale_x_continuous(breaks=seq(2005, 2020, 1)) + scale_fill_brewer(palette = "Dark2") +  theme(legend.position = "bottom") 
#plotly::ggplotly(p1) %>%
#  layout(legend = list(
#      orientation = "h"
#    )
#  )
p1