This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(stringr) | |
library(rvest) | |
# Remember to edit the link to display all search results on a single page | |
# Save results page as html file and then read it in. | |
# Robots.txt disallows scraping of search/ paths, so this approach is a hacky fix | |
# Robots.txt has no problem with scraping content/ paths | |
h <- read_html("../../Downloads/medRxiv_test.html") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyr) | |
# Prep RAYYAN extract for ML ---------------------------------------------- | |
test <- read.csv("articles.csv") | |
# Remove day/month | |
test <- test[,c(1:3,6:17)] | |
test$notes <- gsub("RAYYAN", "| RAYYAN", test$notes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages("europepmc") | |
install.packages("cowplot") | |
install.packages("tidyverse") | |
library(europepmc) | |
library(cowplot) | |
library(tidyverse) | |
ot_trend <- europepmc::epmc_hits_trend(query = "oxytocin", | |
period = 2008:2018) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages("rvest") | |
library(rvest) | |
# DEFINE WEBPAGE BASE ADDRESS # | |
url <- "https://www.medrxiv.org/" | |
# OPEN BASE ADDRESS # | |
browseURL(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(robvis) | |
library(ggplot2) | |
#Define colours (cochrane) | |
low_colour <- "#02C100" | |
concerns_colour <- "#E2DF07" | |
high_colour <- "#BF0000" | |
critical_colour <- "#820000" | |
ni_colour <- "#4EA1F7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SET-UP ------------------------------------------------------------------ | |
# Install and load the package | |
devtools::install_github("mcguinlu/medrxivr") | |
library(medrxivr) | |
# PART 1 ------------------------------------------------------------------ | |
# Read in the data you downloaded from the web-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
library(medrxivr) | |
# Create bx_api_content | |
# Modified version of mx_api_content() | |
bx_api_content <- function(from.date = "2013-01-01", | |
to.date = Sys.Date(), | |
clean = TRUE, | |
include.info = FALSE) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# packages needed | |
library(gridExtra) | |
library(tidyverse) | |
library(patchwork) | |
# this table uses Fira Sans font - this will need to be installed | |
# https://fonts.google.com/specimen/Fira+Sans | |
library(extrafont) |
OlderNewer