阅读Google云端硬盘上托管的csv文件

rem*_*emi 9 csv curl r web

我正在尝试访问(读入R)Google云端硬盘上托管的.csv文件(非驱动器电子表格) - 将文件权限设置为"可公开共享".

所以基于可共享的URL:

sURL <-"https://drive.google.com/file....view?pli=1"
Run Code Online (Sandbox Code Playgroud)

我一直在尝试阅读使用:

library(curl)
x <- curl(sURL)
data <- read.csv(x)
Run Code Online (Sandbox Code Playgroud)

我收到此错误消息:

Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
more columns than column names
Run Code Online (Sandbox Code Playgroud)

不知道投诉的内容是什么?多谢你们.

luk*_*keA 13

你可以这样试试

id <- "0B-wuZ2XMFIBUd09Ob0pKVkRzQTA" # google file ID
read.csv(sprintf("https://docs.google.com/uc?id=%s&export=download", id))
Run Code Online (Sandbox Code Playgroud)