I am relatively new to R and and Im currently working on a structural topic model of a big amount of news headlines/leads.
I am trying to preprocess the data I have collected using the quanteda package but I produce the following error:
Error in data.frame(doc_id = rownames(iran$created_time, ), iran$created_time, : Arguments imply differing number of rows: 0, 67172
Here is my code:
iran <- read.csv("iran_complete.csv", encoding = "UTF-8") #reimporting the data I have previously collected and saved as CSV file. Three columns: created_time, snippet & headline. 67172 observations.
iran.meta <- data.frame(doc_id=rownames(iran$created_time,), iran$created_time, snippet=iran$snippet, headline=iran$headline, stringsAsFactors=FALSE)
I guess I have to convert the created_time column into a row as I later want to use it as the metadata in my stm analysis but this turns out be really tricky for me.
Any help is appreciated as I tried to solve this using other threads on this issues but without success.