Summary
This page is the hand in (final project) for the Coursera course Reproducible Templates for Analysis and Dissemination thought by Melinda Higgins. It countains a few basic R Markdown objects as requested for the assignment:
- Bulleted List (this list with 3 items)
- A plot of the built-in
pressuredataset
- A table of the top 6 rows of the built-in
carsdataset
The layout chosen is the theme cayman from the package prettydoc.
As bonus there are a few elements I also implemented on my Corona-Info-Site for Austria.
Plot of pressure dataset
pressure %>%
ggplot(aes(x=temperature, y=pressure)) +
geom_point() +
labs(title = "Plot of the R-built-in pressure dataset",
x = "Temperature [°C]",
y = "Pressure [mmHg]",
caption = "https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/pressure.html") +
theme_clean()Table of the cars dataset
head(cars) %>%
kbl(align = "cc", col.names = c("Speed [mph]", "Stopping Distance [feet]"),
caption = "Speed and Stopping Distances of Cars (https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/cars.html)") %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed"),
position = "left")| Speed [mph] | Stopping Distance [feet] |
|---|---|
| 4 | 2 |
| 4 | 10 |
| 7 | 4 |
| 7 | 22 |
| 8 | 16 |
| 9 | 10 |
Some Corona Facts and Figures
The following items are parts of my Corona-Data-Infosite for friends and family on https://charmingquark.at/covid.html.
Timeline of dominant Covid variants in Austria
Data source: https://www.ecdc.europa.eu/en/publications-data/data-virus-variants-covid-19-eueea
GISAID Data Acknowledgement: https://www.ecdc.europa.eu/en/publications-data/gisaid-acknowledgements
A sample of positive Covid-tests is genetically sequenced. The following graph is showing the timeline of the percentage of specific variants over time for Austria.
# Last sucessful download on 2022-02-14
ecdc_varseq_weekly <- read.csv(file = "ecdc_varseq_weekly.csv") %>%
mutate(dateRep = as.Date(dateRep)) %>%
mutate(year=str_sub(year_week,1,4), week=str_sub(year_week,6,7),
year_week2=paste0(year,"-W",week,"-1"),
dateRep=ISOweek::ISOweek2date(year_week2))
# Adding the "popular" names of the variants
ecdc_varseq_weekly$variant <- str_replace_all(ecdc_varseq_weekly$variant,
c("B.1.617.2" = "B.1.617.2 (Delta)",
"B.1.1.529" = "B.1.1.529 (Omikron)",
"B.1.1.7" = "B.1.1.7 (Alpha)",
"B.1.1.7+E484K" = "B.1.1.7+E484K (Alpha)",
"B.1.351" = "B.1.351 (Beta)"))
ecdc_varseq_weekly %>%
filter(country_code == "AT", # filtering for Austria
variant != "Other") %>%
group_by(variant) %>%
mutate(percent_variant_max = max(percent_variant, # calculating the maximum percentage of a specific variant over the whole period
na.rm = TRUE)) %>%
filter(percent_variant_max > 10) %>% # only keep variants that had a minimum share of 10% at some point
ungroup() %>%
filter(percent_variant > 0.5) %>% # only plot variant when over 0.5%
ggplot(aes(x = dateRep,
y = percent_variant,
color = factor(variant))) +
geom_line(size = 1) +
scale_x_date(date_labels = "%Y-%m") +
labs(title = "Covid 19 Virus Variants detected in Austria",
subtitle = " only variants that reached a minimum share of 10% at some point in time",
x = "", y = "Share of variant de [%]",
color = "Virus variant",
caption = paste0("Data: gisaid.org via ECDC; ",
max(ecdc_varseq_weekly$dateRep,
na.rm = TRUE))) +
theme_minimal()