MyNixOS website logo
Description

Cases of COVID-19 in Tunisia.

Data personally collected about the spread of COVID-19 (SARS-COV-2) in Tunisia <https://github.com/MounaBelaid/covid19datatunisia>.

This package provides per-day data on COVID-19 cases in Tunisia.

The data is an average over all of the sources provided by Mouna Belaid. Please check out this link.

Installation

Using the programming language R, you can install the released version of covid19tunisia with :

remotes::install_github("MounaBelaid/covid19tunisia")

Usage

data <- refresh_covid19tunisia()

head(data)
#> # A tibble: 6 x 7
  date       location location_type location_code location_code_type data_type value
  <date>     <chr>    <chr>         <chr>         <chr>              <chr>     <dbl>
1 2020-03-02 Gafsa    state         TN-71         iso_3166_2         cases_new     1
2 2020-03-08 Mahdia   state         TN-53         iso_3166_2         cases_new     1
3 2020-03-09 Bizerte  state         TN-23         iso_3166_2         cases_new     1
4 2020-03-09 Mahdia   state         TN-53         iso_3166_2         cases_new     1
5 2020-03-09 Tunis    state         TN-11         iso_3166_2         cases_new     1
6 2020-03-10 Mahdia   state         TN-53         iso_3166_2         cases_new     1

Plotting the daily evolution of active cases

# Transform the data

library(dplyr)
library(tidyr)
library(plotly)

data_transformed <- data %>% group_by(date, data_type) %>% summarise(value = sum(value)) %>% 
                    spread(data_type, value)

head(data_transformed)
# A tibble: 6 x 4
# Groups:   date [6]
  date       cases_new deaths_new recovered_new
  <date>         <dbl>      <dbl>         <dbl>
1 2020-03-02         1          0             0
2 2020-03-08         1          0             0
3 2020-03-09         3          0             0
4 2020-03-10         1          0             0
5 2020-03-11         1          0             0
6 2020-03-12         6          0             0

  data_transformed %>%
  ungroup() %>% plot_ly(type = 'scatter', 
                        mode = 'lines + markers')%>% 
  add_trace(x = ~date, y = ~cumsum(cases_new), 
            name = 'Confirmed cases',
            marker = list(color = '#fec44f'),
            line = list(color = '#fec44f'),
            hoverinfo = "text",
            text = ~paste(cases_new, "New confirmed cases\n", cumsum(cases_new), 'Total number of infected cases on', date)) %>%
  add_trace(x = ~date, y = ~cumsum(deaths_new),
            name = 'Deaths',
            marker = list(color = 'red'),
            line = list(color = 'red'),
            hoverinfo = "text",
            text = ~paste(deaths_new, "New deaths\n", cumsum(deaths_new), 'Total number of deaths on', date)) %>%
  add_trace(x = ~date, y = ~cumsum(recovered_new), 
            name = 'Recovered cases',
            marker = list(color = 'green'),
            line = list(color = 'green'),
            hoverinfo = "text",
            text = ~paste(recovered_new, "New recovered cases\n", cumsum(recovered_new), 'Total number of recovered cases on', date)) %>% 
  layout(title = 'Tunisia - Daily Evolution of Active COVID19 Cases',
         legend = list(x = 0.1, y = 0.9,
                       font = list(family = "sans-serif", size = 14, color = "#000"), bgcolor = "",
                       bordercolor = "#FFFFFF", borderwidth = 2),
         xaxis = list(title = ""),
         yaxis = list(side = 'left', title = 'Daily evolution', showgrid = TRUE, zeroline = TRUE))
                        

Supporting Shiny Application

A supporting Shiny Application for the covid19tunisia dataset available here.

Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows