我是R编程的初学者,我面临着以下代码的问题:
library(xml2)
library(rvest)
library(stringr)
library(qdap)
atiire_details <- c()
for(i in 1:2){
html_pages1<-read_html(paste('E:\Term 1\Data collections\assignmentData\',i,'.html',sep = ''))
details <- html_nodes(html_pages1,'dl:nth-child(22)')
wp1<-html_text(details)
wp1<-gsub("n","",wp1)
wp1<-str_trim(clean(wp1)) # Problem function here!
if(!(length(wp1)==0)){
if(!(wp1=='Take-out Yes')){
atiire_details[i]<-wp1
}}}
df<-data.frame()
df <- rbind(df, data.frame(atiire_details))
out <- capture.output(unique(df$atiire_details))
cat("My title", out, file="E:\R\op1.txt", sep="n", append=TRUE)
我不断收到以下错误:
clean(wp1) 中的错误:找不到函数"clean"
有人可以帮助我吗?提前致谢:)
顺便说一下,我使用了remove.packages(c("qdap", "reshape2")),并在RStudio中重新安装了qdap软件包。它:)感谢您的帮助