My goal is to automate fetching of trends data along with the extraction of "interest_over_time"
from the lists.
Considering it a two-step problem:
Automating fetching of data based on a group of keywords
Extracting elements automatically in a methodical manner
I am not able to complete step 2.
Any ideas on how to get this done?
Step1 - Automating fetch of google trends data
library(gtrendsR)
a <- c("sony", "apple")
for (i in a) {
name <- (paste(i, sep=""))
assign(name, gtrends(keyword=i, time="now 1-H"))
print(name)
}
Step2 - Extracting elements
sony[["interest_over_time"]]
instead of doing it like above manually, can I use for or some other function to automate this?