1 ### COVID-19 Digital Observatory
4 ### Minimal example analysis file using trending search data
6 ### Identify data source directory and file
7 DataDir <- ("../data/output/")
8 DataFile <- ("related_searches_top.csv")
10 ### Import and cleanup data
11 related.searches.top <- read.table(paste(DataDir,DataFile,
14 stringsAsFactors=FALSE)
16 ### Aggregate top 5 search queries by term/day
17 top5.per.term.date <- aggregate(query ~ term + date,
18 data=related.searches.top,
21 ## Might cleanup a bit for further analysis or visualization...
22 top5.per.term.date$date <- as.Date(top5.per.term.date$date)
25 write.table(top5.per.term.date,
26 file="output/top5_queries_per_term_per_date.csv", sep=",",