问题描述
我的项目包括分析音乐专辑的数据。我已经有一个包含信息的数据框,通过这个循环,我打算从 reddit 评论中提取情绪,然后从与专辑相关的所有评论中取出平均值,并在初始数据框中逐行插入。
###Create an empty df to fill with the new values
df = data.frame()
for (i in lista[1:2050]) {
Sys.sleep(5)
###Scraping the comments
prueba<- RedditExtractoR::get_reddit(search_terms = lista[i],subreddit = "music",cn_threshold=10)
### Getting the sentiment from the comments
sent<- sentimentr::sentiment(prueba$comment,polarity_dt = lexicon::hash_sentiment_jockers_rinker)
meansent<- mean(sent$sentiment)
print(i)
databasetodo = rbind(databasetodo,data.frame(meansent,stringsAsFactors = FALSE))
}
通过使用此代码,我收到消息“rbind(deparse.level,...) 中的错误: 参数列数不匹配"
任何帮助将不胜感激,我只是一个初学者
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)