【发布时间】:2018-11-26 11:45:55
【问题描述】:
我有一些文本文件的向量。这是我的处理方式
text[1] <- read_html("link1")
text[2] <- read_html("link2")
text[3] <- read_html("link3")
.
. until text [100]
我想创建一个包含以下内容的语料库:
x <- list(text[i])
z <- lapply(x, read_html)
我明白了
Error in UseMethod("read_xml") : no applicable method for 'read_xml' applied to an object of class "list"
在该错误之前,它是逻辑数据,我已将 text[i] 转换为以下内容
text[i] <- as.character (text[i])
另外,我得到了
number of items to replace is not a multiple of replacement lengthnumber of items to replace is not a multiple of replacement
我无法弄清楚发生了什么。 谢谢。
【问题讨论】:
-
尝试从
x <- list(text[i])中删除[i] -
还是有同样的错误。