Skip to content

Commit

Permalink
made recomended changes, removed old logos and placed hexsticker in c…
Browse files Browse the repository at this point in the history
…orrect location
  • Loading branch information
joseph-palmer committed Jun 28, 2021
1 parent 7cd6f05 commit de74f9b
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 152 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ Description: An interface to subnational and national level COVID-19 data
the UK, and from other Covid-19 data collections, including the World
Health Organisation (WHO), European Centre for Disease Prevention and
Control (ECDC), John Hopkins University (JHU), Google Open Data and
others. Designed to streamline Covid-19 data extraction, cleaning,
and processing from a range of data sources in an open and transparent
others. Designed to streamline Covid-19 data extraction, cleaning, and
processing from a range of data sources in an open and transparent
way. This allows users to inspect and scrutinise the data, and tools
used to process it, at every step. For all countries supported, data
includes a daily time-series of cases. Wherever available data is also
Expand Down Expand Up @@ -103,6 +103,7 @@ Imports:
xml2
Suggests:
ggplot2,
ggspatial,
knitr,
mockery,
pkgdown,
Expand Down
17 changes: 1 addition & 16 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,7 @@ knitr::opts_chunk$set(
)
```


# Hexsticker designs

### Design 1
![Design 1](man/figures/logo1.png)

### Design 2
![design 2](man/figures/logo2.png)

### Design 3
![design 3](man/figures/logo3.png)

### Design 5
![design 5](man/figures/logo5.png)

# Subnational data for the COVID-19 outbreak
# Subnational data for the COVID-19 outbreak <img src="man/figures/logo.png" align="right" alt="" height="150" />

[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html) [![R-CMD-check](https://github.com/epiforecasts/covidregionaldata/workflows/R-CMD-check/badge.svg)](https://github.com/epiforecasts/covidregionaldata/actions) [![Codecov test coverage](https://codecov.io/gh/epiforecasts/covidregionaldata/branch/master/graph/badge.svg)](https://codecov.io/gh/epiforecasts/covidregionaldata?branch=master) [![Data status](https://img.shields.io/badge/Data-status-lightblue.svg?style=flat)](https://epiforecasts.io/covidregionaldata/articles/supported-countries.html) [![metacran downloads](http://cranlogs.r-pkg.org/badges/grand-total/covidregionaldata?color=ff69b4)](https://cran.r-project.org/package=covidregionaldata)

Expand Down
32 changes: 7 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@

# Hexsticker designs

### Design 1

![Design 1](man/figures/logo1.png)

### Design 2

![design 2](man/figures/logo2.png)

### Design 3

![design 3](man/figures/logo3.png)

### Design 5

![design 5](man/figures/logo5.png)

# Subnational data for the COVID-19 outbreak
# Subnational data for the COVID-19 outbreak <img src="man/figures/logo.png" align="right" alt="" height="150" />

[![Lifecycle:
maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html)
Expand Down Expand Up @@ -96,7 +78,7 @@ the temporary directory by default),

``` r
start_using_memoise()
#> Using a cache at: /tmp/Rtmp22YZr9
#> Using a cache at: /tmp/RtmpXdh1Cd
```

To stop using `memoise` use,
Expand All @@ -121,7 +103,7 @@ the Google COVID-19 open data project), use:
``` r
nots <- get_national_data()
#> Downloading data from https://covid19.who.int/WHO-COVID-19-global-data.csv
#> Rows: 126,084
#> Rows: 128,546
#> Columns: 8
#> Delimiter: ","
#> chr [3]: Country_code, Country, WHO_region
Expand All @@ -133,7 +115,7 @@ nots <- get_national_data()
#> Cleaning data
#> Processing data
nots
#> # A tibble: 126,084 x 15
#> # A tibble: 128,690 x 15
#> date un_region who_region country iso_code cases_new cases_total
#> <date> <chr> <chr> <chr> <chr> <dbl> <dbl>
#> 1 2020-01-03 Asia EMRO Afghanistan AF 0 0
Expand All @@ -146,7 +128,7 @@ nots
#> 8 2020-01-03 Americas AMRO Antigua & Bar… AG 0 0
#> 9 2020-01-03 Americas AMRO Argentina AR 0 0
#> 10 2020-01-03 Asia EURO Armenia AM 0 0
#> # … with 126,074 more rows, and 8 more variables: deaths_new <dbl>,
#> # … with 128,680 more rows, and 8 more variables: deaths_new <dbl>,
#> # deaths_total <dbl>, recovered_new <dbl>, recovered_total <dbl>,
#> # hosp_new <dbl>, hosp_total <dbl>, tested_new <dbl>, tested_total <dbl>
```
Expand Down Expand Up @@ -187,7 +169,7 @@ for example by level 1 region in the UK, use:
``` r
uk_nots <- get_regional_data(country = "UK", verbose = FALSE)
uk_nots
#> # A tibble: 6,565 x 26
#> # A tibble: 6,695 x 26
#> date region region_code cases_new cases_total deaths_new deaths_total
#> <date> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 2020-01-30 East Mi… E12000004 NA NA NA NA
Expand All @@ -200,7 +182,7 @@ uk_nots
#> 8 2020-01-30 Scotland S92000003 NA NA NA NA
#> 9 2020-01-30 South E… E12000008 NA NA NA NA
#> 10 2020-01-30 South W… E12000009 NA NA NA NA
#> # … with 6,555 more rows, and 19 more variables: recovered_new <dbl>,
#> # … with 6,685 more rows, and 19 more variables: recovered_new <dbl>,
#> # recovered_total <dbl>, hosp_new <dbl>, hosp_total <dbl>, tested_new <dbl>,
#> # tested_total <dbl>, areaType <chr>, cumCasesByPublishDate <dbl>,
#> # cumCasesBySpecimenDate <dbl>, newCasesByPublishDate <dbl>,
Expand Down
1 change: 1 addition & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ geocoding
getRversion
GFM
ggplot
ggspatial
Gimma
github
Github
Expand Down
118 changes: 9 additions & 109 deletions inst/make_hexsticker.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,78 +22,6 @@ regional_countries_l2 <- regional_countries %>%
regional_countries_l1 <- regional_countries %>%
filter(is.na(.data$level_2_region))

# get world data
world <- spData::world %>%
st_as_sf()


# mark supported countries from the world data
supported_countries <- world %>%
mutate(
fill = case_when(
name_long %in% countryname(regional_countries_l2[["origin"]], destination = "country.name.en") ~ "Level 2",
name_long %in% countryname(regional_countries[["origin"]], destination = "country.name.en") ~ "Level 1",
TRUE ~ "Unsupported"
)
)

# make covid map
covid_map_1 <- ggplot() +
ggspatial::layer_spatial(data = supported_countries, aes(fill = fill, color = fill, size = fill)) +
coord_sf(crs = "ESRI:54010") +
scale_fill_manual(
name = "",
values = c("#0072b2", "#cc79a7", "grey80")
) +
scale_color_manual(
name = "",
values = c("black", "black", "#666666")
) +
scale_size_manual(
name = "",
values = c(0.1, 0.1, 0.018)
) +
cowplot::theme_minimal_grid(color = "white", line_size = 0.05) +
theme(legend.position = "none", axis.text.x = element_blank())

logo1 <- sticker(
covid_map_1,
package = "covidregionaldata",
p_size = 48, s_x = 1, s_y = 0.8, s_width = 1.98, s_height = 1.98,
p_y = 1.45,
p_color = "white",
p_family = "useme",
h_color = "#646770",
h_fill = "#24A7DF",
filename = "man/figures/logo1.png",
u_size = 3.5,
dpi = 1000
)

# make logo 2
supported_countries <- supported_countries %>%
filter(name_long != "Antarctica")

covid_map_2 <- ggplot() +
ggspatial::layer_spatial(data = supported_countries, aes(fill = fill, size = fill, color = fill)) +
coord_sf(crs = "ESRI:54016") +
scale_fill_manual(
name = "",
values = c("#0072b2", "#cc79a7", "grey80")
) +
scale_color_manual(
name = "",
values = c("black", "black", "#666666")
) +
scale_size_manual(
name = "",
values = c(0.1, 0.1, 0.018)
) +
theme_void() +
theme(legend.position = "none", axis.text.x = element_blank())

print(covid_map_2)

# Approach using Natural Earth data

world_without_regions <- ne_countries(returnclass = "sf") %>%
Expand Down Expand Up @@ -136,67 +64,39 @@ regional_outlines <- ms_lines(
),
returnclass = "sf"
),
keep = 0.5
keep = 0.1,
scale = 50
)
)


covid_map_3 <- ggplot() +
covid_map <- ggplot() +
ggspatial::layer_spatial(data = world_without_regions, size = 0.01) +
ggspatial::layer_spatial(
data = regional_maps,
aes(fill = region_code), size = 0.02
) +
ggspatial::layer_spatial(
data = regional_outlines,
aes(colour = 1), size = 0.1
aes(colour = factor(RANK)), size = 0.1
) +
coord_sf(crs = "ESRI:54016") +
scale_fill_fermenter(palette = "RdBu") +
theme_void() +
scale_colour_manual(name = "", values = c("black", "black", "black")) +
theme(legend.position = "none", axis.text.x = element_blank())

print(covid_map_3)

logo2 <- sticker(
covid_map_2,
package = "covidregionaldata",
p_size = 48, s_x = 0.96, s_y = 0.8, s_width = 1.7, s_height = 1.7,
p_y = 1.45,
p_color = "white",
p_family = "useme",
h_color = "#646770",
h_fill = "#24A7DF",
filename = "man/figures/logo2.png",
u_size = 3.5,
dpi = 1000
)
print(covid_map)

logo3 <- sticker(
covid_map_2,
logo <- sticker(
covid_map,
package = "covidregionaldata",
p_size = 48, s_x = 1, s_y = 0.8, s_width = 1.7, s_height = 1.7,
p_y = 1.45,
p_color = "white",
p_family = "useme",
h_color = "#646770",
h_fill = "#24A7DF",
filename = "man/figures/logo3.png",
filename = "man/figures/logo.png",
u_size = 3.5,
dpi = 1000
)

logo4 <- sticker(
covid_map_3,
package = "covidregionaldata",
p_size = 48, s_x = 1, s_y = 0.8, s_width = 1.7, s_height = 1.7,
p_y = 1.45,
p_color = "white",
p_family = "useme",
h_color = "#646770",
h_fill = "#24A7DF",
filename = "man/figures/logo5.png",
u_size = 3.5,
dpi = 1000
)

Binary file modified man/figures/README-g7_plot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-uk_plot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed man/figures/logo1.png
Binary file not shown.
Binary file removed man/figures/logo2.png
Binary file not shown.
Binary file removed man/figures/logo3.png
Binary file not shown.
Binary file removed man/figures/logo4.png
Binary file not shown.
Binary file removed man/figures/logo5.png
Binary file not shown.

0 comments on commit de74f9b

Please sign in to comment.