diff --git a/figures.Rmd b/figures.Rmd index af4a6e3..6d8db0a 100644 --- a/figures.Rmd +++ b/figures.Rmd @@ -457,7 +457,6 @@ p2E <- preprints %>% scale_x_date(date_breaks = "1 month", date_minor_breaks = "1 month", date_labels = "%b") + - theme(axis.text.x = element_text(angle = 45, hjust = 1)) + ggsave("outputs/figures/partials/Figure_2E.png", width = 10, height = 4) # Panel F: Reference counts @@ -482,7 +481,6 @@ p2F <- preprints %>% scale_x_date(date_breaks = "1 month", date_minor_breaks = "1 month", date_labels = "%b") + - theme(axis.text.x = element_text(angle = 45, hjust = 1)) + ggsave("outputs/figures/partials/Figure_2F.png", width = 10, height = 4) p <- p2A + p2B + p2C + p2D + p2E + p2F + @@ -654,17 +652,18 @@ p3B <- preprints %>% posted_date <= analysis_end, institution_match_country_code %in% top_n_countries) %>% count(institution_match_country_code, covid_preprint) %>% - group_by(institution_match_country_code) %>% - mutate(total_n = sum(n)) %>% + group_by(covid_preprint) %>% + mutate(total_n = sum(n), + proportion = (n/sum(n))*100) %>% ungroup() %>% mutate(continent = countrycode::countrycode(institution_match_country_code, origin = 'iso2c', destination = 'continent')) %>% assign_covid_preprint() %>% - ggplot(aes(x = reorder(institution_match_country_code, -n), y = n, fill = covid_preprint)) + + ggplot(aes(x = reorder(institution_match_country_code, -n), y = proportion, fill = covid_preprint)) + geom_col(color = "grey50", position = position_dodge(preserve = "single"), width = 0.75, size = 0.25) + - labs(x = "Country of corresponding author", y = "Preprints deposited", fill = "") + + labs(x = "Country of corresponding author", y = "% of preprints", fill = "") + scale_fill_manual(values = qualitative_hcl(2, palette = "Set2")) + theme(legend.position = "top") + ggsave("outputs/figures/partials/Figure_3B.png", width = 5, height = 4) @@ -874,8 +873,7 @@ p4A <- preprints %>% scale_x_date(date_breaks = "1 month", date_minor_breaks = "1 month", date_labels = "%b") + - theme(axis.text.x = element_text(angle = 45, hjust = 1), - legend.position = "top") + + theme(legend.position = "top") + ggsave("outputs/figures/partials/Figure_4A.png", width = 5, height = 4) # Panel B: Journal locations of published papers (top 10) @@ -1005,7 +1003,6 @@ p5A <- d %>% scale_x_date(date_breaks = "1 month", date_minor_breaks = "1 month", date_labels = "%b") + - theme(axis.text.x = element_text(angle = 45, hjust = 1)) + ggsave("outputs/figures/partials/Figure_5A.png", width = 10, height = 4) # PDF downloads @@ -1025,7 +1022,6 @@ p5B <- d %>% scale_x_date(date_breaks = "1 month", date_minor_breaks = "1 month", date_labels = "%b") + - theme(axis.text.x = element_text(angle = 45, hjust = 1)) + ggsave("outputs/figures/partials/Figure_5B.png", width = 10, height = 4) # Patchwork @@ -1039,7 +1035,59 @@ p5A + p5B + plot_layout(ncol = 1) + ```{r} -# Panel A: Abstract views (bioRxiv + medRxiv, non-COVID) +# Panel A: Abstract views in first month after posting +d <- preprint_usage %>% + mutate( + collection_month = str_sub(collection_date, 1, 3), + collection_year = str_c("20", str_sub(collection_date, + nchar(collection_date) - 1, + nchar(collection_date))), + collection_date = my(str_c(collection_month, collection_year))) %>% + inner_join(preprints, by = "doi") %>% + assign_covid_preprint() %>% + mutate(posted_month = floor_date(posted_date, unit = "month")) %>% + filter(posted_month >= analysis_start, + posted_month <= analysis_end, + posted_month == collection_date) + +pS3A <- d %>% + ggplot(aes(x = posted_month, y = abstract_views, color = covid_preprint, + group = interaction(posted_month, covid_preprint))) + + geom_jitter(aes(fill = factor(covid_preprint)), + shape = 21, size = 0.25, alpha = 0.1, + position = position_jitterdodge(jitter.width = 15, dodge.width = 21)) + + geom_boxplot(width = 20, outlier.shape = NA, fill = NA, + position = position_dodge(width = 21)) + + labs(x = "Posted Month", y = "Abstract views in posting month", + fill = "", color = "") + + scale_y_log10(labels = scales::comma, limits = c(1, 1e6), expand = c(0, 0)) + + scale_color_manual(values = qualitative_hcl(2, palette = "Set2")) + + scale_fill_manual(values = qualitative_hcl(2, palette = "Set2")) + + scale_x_date(date_breaks = "1 month", + date_minor_breaks = "1 month", + date_labels = "%b") + + ggsave("outputs/figures/partials/Figure_S3A.png", width = 10, height = 4) + +# Panel B: PDF downloads +pS3B <- d %>% + ggplot(aes(x = posted_month, y = pdf_downloads, color = covid_preprint, + group = interaction(posted_month, covid_preprint))) + + geom_jitter(aes(fill = factor(covid_preprint)), + shape = 21, size = 0.25, alpha = 0.1, + position = position_jitterdodge(jitter.width = 15, dodge.width = 21)) + + geom_boxplot(width = 20, outlier.shape = NA, fill = NA, + position = position_dodge(width = 21)) + + labs(x = "Posted Month", y = "PDF downloads in posting month", + fill = "", color = "") + + scale_y_log10(labels = scales::comma, limits = c(1, 1e6), expand = c(0, 0)) + + scale_color_manual(values = qualitative_hcl(2, palette = "Set2")) + + scale_fill_manual(values = qualitative_hcl(2, palette = "Set2")) + + scale_x_date(date_breaks = "1 month", + date_minor_breaks = "1 month", + date_labels = "%b") + + ggsave("outputs/figures/partials/Figure_S3B.png", width = 10, height = 4) + +# Panel C: Abstract views (bioRxiv + medRxiv, non-COVID) d <- preprint_usage %>% inner_join(preprints, by = "doi") %>% filter(covid_preprint != T) %>% @@ -1052,7 +1100,7 @@ d <- preprint_usage %>% filter(posted_date >= "2019-01-01", posted_date <= analysis_end) -pS3A <- d %>% +pS3C <- d %>% ggplot(aes(x = posted_month, y = abstract_views, group = posted_month)) + geom_boxplot(outlier.shape = NA) + geom_jitter(shape = 21, size = 0.2, alpha = 0.1) + @@ -1066,11 +1114,10 @@ pS3A <- d %>% date_labels = "%b-%y", expand = c(0.01,0.01)) + theme(axis.text.x = element_text(angle = 45, hjust = 1)) + - ggsave("outputs/figures/partials/Figure_S3A.png", width = 10, height = 4) - -# Panel B: PDF downloads (bioRxiv + medRxiv, non-COVID) + ggsave("outputs/figures/partials/Figure_S3C.png", width = 10, height = 4) -pS3B <- d %>% +# Panel D: PDF downloads (bioRxiv + medRxiv, non-COVID) +pS3D <- d %>% ggplot(aes(x = posted_month, y = pdf_downloads, group = posted_month)) + geom_boxplot(outlier.shape = NA) + geom_jitter(shape = 21, size = 0.2, alpha = 0.1) + @@ -1084,9 +1131,9 @@ pS3B <- d %>% date_labels = "%b-%y", expand = c(0.01,0.01)) + theme(axis.text.x = element_text(angle = 45, hjust = 1)) + - ggsave("outputs/figures/partials/Figure_S3B.png", width = 10, height = 4) + ggsave("outputs/figures/partials/Figure_S3D.png", width = 10, height = 4) -# Panel C: PDF downloads for additional preprint servers +# Panel E: PDF downloads for additional preprint servers # Bind into one data frame all_server_dloads <- bind_rows(preprint_usage %>% inner_join(preprints, by = c("doi", "source")) %>% @@ -1099,7 +1146,7 @@ all_server_dloads <- bind_rows(preprint_usage %>% filter(posted_date >= analysis_start & posted_date <= analysis_end) # Generate plot -pS3C <- all_server_dloads %>% +pS3E <- all_server_dloads %>% assign_covid_preprint() %>% ggplot(aes(x = source, y = pdf_downloads, color = covid_preprint)) + geom_boxplot(outlier.shape = NA) + @@ -1111,14 +1158,13 @@ pS3C <- all_server_dloads %>% scale_y_log10(labels = scales::comma, limits = c(1, 1e7), expand = c(0, 0)) + scale_color_manual(values = qualitative_hcl(2, palette = "Set2")) + scale_fill_manual(values = qualitative_hcl(2, palette = "Set2")) + - theme(legend.position = "top") + - ggsave("outputs/figures/partials/Figure_S3C.png", width = 10, height = 4) + ggsave("outputs/figures/partials/Figure_S3E.png", width = 10, height = 4) # Patchwork -pS3A + pS3B + pS3C + - plot_layout(nrow = 3) + +pS3A + pS3B + pS3C + pS3D + pS3E + + plot_layout(nrow = 5) + plot_annotation(tag_levels = "A") + - ggsave("outputs/figures/Figure_S3.png", width = 10, height = 8) + ggsave("outputs/figures/Figure_S3.png", width = 10, height = 14) ``` @@ -1136,7 +1182,7 @@ d <- preprints %>% week_start = 1)) %>% assign_covid_preprint() -plot_main <- function(d, title_y) { +plot_main <- function(d, title_y, limit_y) { d %>% group_by(covid_preprint, posted_week) %>% @@ -1146,7 +1192,7 @@ plot_main <- function(d, title_y) { geom_line() + geom_point(shape = 21) + labs(x = "Date posted", y = title_y, fill = "", color = "") + - scale_y_continuous(labels = scales::percent, limits = c(0,1)) + + scale_y_continuous(labels = scales::percent, limits = c(0,limit_y)) + scale_color_manual(values = qualitative_hcl(2, palette = "Set2")) + scale_fill_manual(values = qualitative_hcl(2, palette = "Set2")) + guides(fill = FALSE) + @@ -1180,7 +1226,8 @@ plot_inset <- function(d, title_y) { # Citations p6A_main <- d %>% mutate(is_cited = as.numeric(citations > 0)) %>% - plot_main(title_y = str_wrap("% of preprints with \u2265 1 citation", 30)) + plot_main(title_y = str_wrap("% of preprints with \u2265 1 citation", 30), + limit_y = 1) p6A_inset <- d %>% mutate(metric = citations) %>% plot_inset(title_y = "Citations") @@ -1194,7 +1241,8 @@ p6A <- p6A_main + # Twitter p6B_main <- d %>% mutate(is_cited = as.numeric(twitter > 1)) %>% - plot_main(title_y = str_wrap("% of preprints with \u2265 2 tweets*", 30)) + plot_main(title_y = str_wrap("% of preprints with \u2265 2 tweets*", 30), + limit_y = 1) p6B_inset <- d %>% mutate(metric = twitter) %>% plot_inset(title_y = "Tweets") @@ -1208,7 +1256,8 @@ p6B <- p6B_main + # News p6C_main <- d %>% mutate(is_cited = as.numeric(news > 0)) %>% - plot_main(title_y = str_wrap("% of preprints mentioned in \u2265 1 news article", 30)) + plot_main(title_y = str_wrap("% of preprints mentioned in \u2265 1 news article", 30), + limit_y = 1) p6C_inset <- d %>% mutate(metric = news) %>% plot_inset(title_y = "News") @@ -1222,7 +1271,8 @@ p6C <- p6C_main + # Blogs p6D_main <- d %>% mutate(is_cited = as.numeric(blogs > 0)) %>% - plot_main(title_y = str_wrap("% of preprints mentioned in \u2265 1 blog post", 30)) + plot_main(title_y = str_wrap("% of preprints mentioned in \u2265 1 blog post", 30), + limit_y = 1) p6D_inset <- d %>% mutate(metric = blogs) %>% plot_inset(title_y = "Blogs") @@ -1236,7 +1286,8 @@ p6D <- p6D_main + # Wikipedia p6E_main <- d %>% mutate(is_cited = as.numeric(wikipedia > 0)) %>% - plot_main(title_y = str_wrap("% of preprints with \u2265 1 Wikipedia citation", 30)) + plot_main(title_y = str_wrap("% of preprints with \u2265 1 Wikipedia citation", 30), + limit_y = 0.1) p6E_inset <- d %>% mutate(metric = wikipedia) %>% plot_inset("Wikipedia") @@ -1244,13 +1295,14 @@ p6E <- p6E_main + annotation_custom(ggplotGrob(p6E_inset), xmin = as.Date("2020-06-01"), xmax = as.Date("2020-11-07"), - ymin = 0.4, ymax = 1.04) + + ymin = 0.04, ymax = 0.104) + ggsave("outputs/figures/partials/Figure_6E.png", width = 5, height = 4) # Comments p6F_main <- d %>% mutate(is_cited = as.numeric(comments_count > 0)) %>% - plot_main(title_y = str_wrap("% of preprints with \u2265 1 comment", 30)) + plot_main(title_y = str_wrap("% of preprints with \u2265 1 comment", 30), + limit_y = 1) p6F_inset <- d %>% mutate(metric = comments_count) %>% plot_inset(title_y = "Comments") diff --git a/outputs/figures/Figure_1.png b/outputs/figures/Figure_1.png index e3d26e6..872ffb7 100644 Binary files a/outputs/figures/Figure_1.png and b/outputs/figures/Figure_1.png differ diff --git a/outputs/figures/Figure_2.png b/outputs/figures/Figure_2.png index 6500ec2..032a2b7 100644 Binary files a/outputs/figures/Figure_2.png and b/outputs/figures/Figure_2.png differ diff --git a/outputs/figures/Figure_3.png b/outputs/figures/Figure_3.png index d6b402d..4209669 100644 Binary files a/outputs/figures/Figure_3.png and b/outputs/figures/Figure_3.png differ diff --git a/outputs/figures/Figure_4.png b/outputs/figures/Figure_4.png index 5393c30..2be5c6e 100644 Binary files a/outputs/figures/Figure_4.png and b/outputs/figures/Figure_4.png differ diff --git a/outputs/figures/Figure_5.png b/outputs/figures/Figure_5.png index 54512b5..0b2aeec 100644 Binary files a/outputs/figures/Figure_5.png and b/outputs/figures/Figure_5.png differ diff --git a/outputs/figures/Figure_6.png b/outputs/figures/Figure_6.png index 27228c4..a609dad 100644 Binary files a/outputs/figures/Figure_6.png and b/outputs/figures/Figure_6.png differ diff --git a/outputs/figures/Figure_S1.png b/outputs/figures/Figure_S1.png index 9c83247..34c04ec 100644 Binary files a/outputs/figures/Figure_S1.png and b/outputs/figures/Figure_S1.png differ diff --git a/outputs/figures/Figure_S2.png b/outputs/figures/Figure_S2.png index d98222c..ae65cd5 100644 Binary files a/outputs/figures/Figure_S2.png and b/outputs/figures/Figure_S2.png differ diff --git a/outputs/figures/Figure_S3.png b/outputs/figures/Figure_S3.png index cb430f0..7cdad09 100644 Binary files a/outputs/figures/Figure_S3.png and b/outputs/figures/Figure_S3.png differ diff --git a/outputs/figures/Figure_S4.png b/outputs/figures/Figure_S4.png index d94a0a5..4161776 100644 Binary files a/outputs/figures/Figure_S4.png and b/outputs/figures/Figure_S4.png differ diff --git a/outputs/figures/partials/Figure_1A.png b/outputs/figures/partials/Figure_1A.png index c03cfa2..345b2d6 100644 Binary files a/outputs/figures/partials/Figure_1A.png and b/outputs/figures/partials/Figure_1A.png differ diff --git a/outputs/figures/partials/Figure_1B.png b/outputs/figures/partials/Figure_1B.png index 41a715d..b749d02 100644 Binary files a/outputs/figures/partials/Figure_1B.png and b/outputs/figures/partials/Figure_1B.png differ diff --git a/outputs/figures/partials/Figure_1C.png b/outputs/figures/partials/Figure_1C.png index 610bf8b..9c917b4 100644 Binary files a/outputs/figures/partials/Figure_1C.png and b/outputs/figures/partials/Figure_1C.png differ diff --git a/outputs/figures/partials/Figure_2A.png b/outputs/figures/partials/Figure_2A.png index d8ff029..5ba6eba 100644 Binary files a/outputs/figures/partials/Figure_2A.png and b/outputs/figures/partials/Figure_2A.png differ diff --git a/outputs/figures/partials/Figure_2E.png b/outputs/figures/partials/Figure_2E.png index a72f3b1..435c2d5 100644 Binary files a/outputs/figures/partials/Figure_2E.png and b/outputs/figures/partials/Figure_2E.png differ diff --git a/outputs/figures/partials/Figure_2F.png b/outputs/figures/partials/Figure_2F.png index 009e400..0be8f03 100644 Binary files a/outputs/figures/partials/Figure_2F.png and b/outputs/figures/partials/Figure_2F.png differ diff --git a/outputs/figures/partials/Figure_3A.png b/outputs/figures/partials/Figure_3A.png index 40f5fbd..bc8e43d 100644 Binary files a/outputs/figures/partials/Figure_3A.png and b/outputs/figures/partials/Figure_3A.png differ diff --git a/outputs/figures/partials/Figure_3B.png b/outputs/figures/partials/Figure_3B.png index 37ee99b..b1a1b23 100644 Binary files a/outputs/figures/partials/Figure_3B.png and b/outputs/figures/partials/Figure_3B.png differ diff --git a/outputs/figures/partials/Figure_3C.png b/outputs/figures/partials/Figure_3C.png index 4bd5e52..89d2e8b 100644 Binary files a/outputs/figures/partials/Figure_3C.png and b/outputs/figures/partials/Figure_3C.png differ diff --git a/outputs/figures/partials/Figure_3D.png b/outputs/figures/partials/Figure_3D.png index 5531a4b..cefe8ce 100644 Binary files a/outputs/figures/partials/Figure_3D.png and b/outputs/figures/partials/Figure_3D.png differ diff --git a/outputs/figures/partials/Figure_4A.png b/outputs/figures/partials/Figure_4A.png index fc4f48a..5644223 100644 Binary files a/outputs/figures/partials/Figure_4A.png and b/outputs/figures/partials/Figure_4A.png differ diff --git a/outputs/figures/partials/Figure_4D.png b/outputs/figures/partials/Figure_4D.png index 59a8714..d412ede 100644 Binary files a/outputs/figures/partials/Figure_4D.png and b/outputs/figures/partials/Figure_4D.png differ diff --git a/outputs/figures/partials/Figure_5A.png b/outputs/figures/partials/Figure_5A.png index f92773e..fda6c2e 100644 Binary files a/outputs/figures/partials/Figure_5A.png and b/outputs/figures/partials/Figure_5A.png differ diff --git a/outputs/figures/partials/Figure_5B.png b/outputs/figures/partials/Figure_5B.png index 17b14bf..81776de 100644 Binary files a/outputs/figures/partials/Figure_5B.png and b/outputs/figures/partials/Figure_5B.png differ diff --git a/outputs/figures/partials/Figure_6A.png b/outputs/figures/partials/Figure_6A.png index 18a4880..95e6fad 100644 Binary files a/outputs/figures/partials/Figure_6A.png and b/outputs/figures/partials/Figure_6A.png differ diff --git a/outputs/figures/partials/Figure_6B.png b/outputs/figures/partials/Figure_6B.png index 1adf584..248a38a 100644 Binary files a/outputs/figures/partials/Figure_6B.png and b/outputs/figures/partials/Figure_6B.png differ diff --git a/outputs/figures/partials/Figure_6C.png b/outputs/figures/partials/Figure_6C.png index e1e9d84..47ce082 100644 Binary files a/outputs/figures/partials/Figure_6C.png and b/outputs/figures/partials/Figure_6C.png differ diff --git a/outputs/figures/partials/Figure_6D.png b/outputs/figures/partials/Figure_6D.png index 7c231f0..372f4a9 100644 Binary files a/outputs/figures/partials/Figure_6D.png and b/outputs/figures/partials/Figure_6D.png differ diff --git a/outputs/figures/partials/Figure_6E.png b/outputs/figures/partials/Figure_6E.png index 9fceaea..ecd5eef 100644 Binary files a/outputs/figures/partials/Figure_6E.png and b/outputs/figures/partials/Figure_6E.png differ diff --git a/outputs/figures/partials/Figure_6F.png b/outputs/figures/partials/Figure_6F.png index e902904..83229e8 100644 Binary files a/outputs/figures/partials/Figure_6F.png and b/outputs/figures/partials/Figure_6F.png differ diff --git a/outputs/figures/partials/Figure_6G.png b/outputs/figures/partials/Figure_6G.png index 65d153a..a0ede9d 100644 Binary files a/outputs/figures/partials/Figure_6G.png and b/outputs/figures/partials/Figure_6G.png differ diff --git a/outputs/figures/partials/Figure_6H.png b/outputs/figures/partials/Figure_6H.png index 9f38efd..bcc39d2 100644 Binary files a/outputs/figures/partials/Figure_6H.png and b/outputs/figures/partials/Figure_6H.png differ diff --git a/outputs/figures/partials/Figure_6I.png b/outputs/figures/partials/Figure_6I.png index b4e8818..cdd2ea2 100644 Binary files a/outputs/figures/partials/Figure_6I.png and b/outputs/figures/partials/Figure_6I.png differ diff --git a/outputs/figures/partials/Figure_S1B.png b/outputs/figures/partials/Figure_S1B.png index 75fa561..3e76c1e 100644 Binary files a/outputs/figures/partials/Figure_S1B.png and b/outputs/figures/partials/Figure_S1B.png differ diff --git a/outputs/figures/partials/Figure_S2A.png b/outputs/figures/partials/Figure_S2A.png index b90a5fc..d04c6da 100644 Binary files a/outputs/figures/partials/Figure_S2A.png and b/outputs/figures/partials/Figure_S2A.png differ diff --git a/outputs/figures/partials/Figure_S3A.png b/outputs/figures/partials/Figure_S3A.png index ecdf1a9..ccae728 100644 Binary files a/outputs/figures/partials/Figure_S3A.png and b/outputs/figures/partials/Figure_S3A.png differ diff --git a/outputs/figures/partials/Figure_S3B.png b/outputs/figures/partials/Figure_S3B.png index 19fe8da..3090377 100644 Binary files a/outputs/figures/partials/Figure_S3B.png and b/outputs/figures/partials/Figure_S3B.png differ diff --git a/outputs/figures/partials/Figure_S3C.png b/outputs/figures/partials/Figure_S3C.png index 093fcc7..bbf1b8b 100644 Binary files a/outputs/figures/partials/Figure_S3C.png and b/outputs/figures/partials/Figure_S3C.png differ diff --git a/outputs/figures/partials/Figure_S3D.png b/outputs/figures/partials/Figure_S3D.png new file mode 100644 index 0000000..c48837d Binary files /dev/null and b/outputs/figures/partials/Figure_S3D.png differ diff --git a/outputs/figures/partials/Figure_S3E.png b/outputs/figures/partials/Figure_S3E.png new file mode 100644 index 0000000..26f1ae1 Binary files /dev/null and b/outputs/figures/partials/Figure_S3E.png differ diff --git a/outputs/figures/partials/Figure_S4A.png b/outputs/figures/partials/Figure_S4A.png index 9470847..aa7d227 100644 Binary files a/outputs/figures/partials/Figure_S4A.png and b/outputs/figures/partials/Figure_S4A.png differ diff --git a/outputs/figures/partials/Figure_S4B.png b/outputs/figures/partials/Figure_S4B.png index 37097e8..38c89ac 100644 Binary files a/outputs/figures/partials/Figure_S4B.png and b/outputs/figures/partials/Figure_S4B.png differ