正在将github中的dput()寄存器读取到R中



我正试图从Github:中读取一个包含dput的要点

library(RCurl)
data <- getURL("https://gist.githubusercontent.com/aronlindberg/848b8efef154d0e7fdb4/raw/5bf4bb864cc4c1db0f66da1be85515b4fa19bf6b/pull_lists")
pull_lists <- dget(textConnection(data))

这将生成:

Error: 'U' used without hex digits in character string starting ""@@ -1,7 +1,9 @@
 module ActionDispatch
   module Http
     module URL
-      # Returns the complete U"

我认为这是Ruby错误消息,而不是R错误。现在考虑一下:

data <- getURL("https://gist.githubusercontent.com/aronlindberg/b6b934b39e3c3378c3b2/raw/9b1efe9340c5b1c8acfdc90741260d1d554b2af0/data")
 pull_lists2 <- dget(textConnection(data))

这似乎很有效。前一个要点相当大,1.7mb。这可能是我不能从Github上阅读它的原因吗。如果没有,为什么?

您创建的gist中没有.R文件,因为pull_lists没有扩展名。我把你的要点转移到这一点上,并添加了扩展。现在可以获取要点并将其保存为值。
library("devtools")
pull_lists <- source_gist("a7b157cec3b9259fc5d1")

最新更新