Skip to content

Instantly share code, notes, and snippets.

@mcguinlu
Last active November 28, 2019 12:11
Show Gist options
  • Save mcguinlu/a8a046eacb8c3ed52e557c3314c3fb0f to your computer and use it in GitHub Desktop.
Save mcguinlu/a8a046eacb8c3ed52e557c3314c3fb0f to your computer and use it in GitHub Desktop.
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)
test2 <- separate(test, notes, c("notes","relevant", "notes3", "notes4"), sep = "\\|")
test2$relevant <- gsub("RAYYAN-INCLUSION: \\{\"Luke\"=>\"Excluded\"\\}", "0",test2$relevant )
test2$relevant <- gsub("RAYYAN-INCLUSION: \\{\"Luke\"=>\"Included\"\\}", "1",test2$relevant )
test2$relevant <- gsub("RAYYAN-INCLUSION: \\{\"Luke\"=>\"Maybe\"\\}", "0.5",test2$relevant )
# Map to relevant keywords from original extract
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment