我正在尝试将我手动创建的列表对象保存到以下内容中list
我可以很快参考的格式。
保存的对象应该能够作为list
not df
或任何东西。
下面是我的列表对象的一部分:
citations <- list(
as.integer(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 111)),
as.integer(c(2, 3, 4, 5, 6, 7, 8, 9, 10, 111)),
as.integer(c(1, 3, 4, 5, 6, 7, 8, 9, 10, 111)),
as.integer(111),
as.integer(111),
as.integer(111),
as.integer(111),
as.integer(111),
as.integer(111),
as.integer(111),
as.integer(111),
as.integer(6),
integer(0),
as.integer(c(14, 15, 16, 17, 18, 19, 20, 21, 22, 23))
)
我已经参考过这个线程 https://stackoverflow.com/questions/31893844/how-can-i-save-a-list-to-a-file-and-read-it-in-again-in-r还有更早的一篇nabble http://r.789695.n4.nabble.com/Save-amp-reload-list-objects-td4639397.html,他们建议简单地使用save
and load
,但每当我应用时,我就是不明白这是如何工作的save()
函数在list
对象并为其指定了一个 R 对象,我总是收到错误消息。
save(citations, "/~citations.Rdata")
Error in save(citations, "~/citations.Rdata") : object ‘~/citations.Rdata’ not found
只是不知道是否需要其他函数调用。