我有数据帧,我想运行下面的代码。然而,我得到了这个错误。据我所知,我需要使用.data格式的数据。
mutate(file = "mix.data") %>% # add the name of our file
mutate(filenumber = as.numeric(str_match(file, "\\d{4}"))) %>% # add the year
mutate(topic = str_match(file, "(.*?)_")[2]) # add president我正在运行下面的链接中的代码,如果你想看的话。
https://www.kaggle.com/rtatman/tutorial-sentiment-analysis-in-r/notebook
所以在运行我的代码之前,你能告诉我需要的代码是什么吗?
谢谢。
发布于 2019-02-28 20:01:13
如果您单独运行这些代码行,而没有数据,则会出现该错误。您需要像这样输入数据:
tokens %>%
mutate(file = "mix.data") %>% # add the name of our file
mutate(filenumber = as.numeric(str_match(file, "\\d{4}"))) %>% # add the year
mutate(topic = str_match(file, "(.*?)_")[2]) # add presidenthttps://stackoverflow.com/questions/54924756
复制相似问题