我想保存作为 htmlParse 命令结果的对象。这是一些代码来说明我的问题。简单地说,我希望能够将解析 HTML 页面保存到一个对象并将其加载到未来的会话中。
library(XML)
PATH = "/colleges/Bentley-University"
URL <- paste("http://www.cappex.com", PATH, sep="")
doc <- htmlParse(URL)
mylist <- list(doc)
mylist[[1]]
save(mylist, file="mylist.Rdata")
rm(list=ls())
load("mylist.Rdata")
但是,当我尝试回忆列表的内容时,这是我得到的错误:
> mylist[[1]]
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
cannot open file '/var/folders/hv/wtvckymn0230hpsdwylmtf0r0000gn/T//Rtmp8Mrpev/fileed256550e50': No such file or directory