【问题标题】:Reading a .por dataset into R from google drive从谷歌驱动器将 .por 数据集读入 R
【发布时间】:2020-07-30 22:12:04
【问题描述】:

在this answer 之后,我正在尝试通过可共享链接 (https://drive.google.com/file/d/124WOY4iBXxv_9eBXsoHJVUzX98x2sxYy/view?usp=sharing) 将 .por 文件读入 R,但没有成功(使用 haven 包):

Error in df_parse_por_file(spec, encoding = "", user_na = user_na, cols_skip

这可以修复吗?

尝试了以下方法:

library(haven) 
id <- '124WOY4iBXxv_9eBXsoHJVUzX98x2sxYy'
j <- sprintf("https://docs.google.com/uc?id=%s&export=download", id)

dta <- haven::read_por(j)

【问题讨论】:

    标签: r dataframe csv url import


    【解决方案1】:

    您可以先使用googledrive包下载文件:

    library(googledrive)
    googledrive::drive_download('https://drive.google.com/file/d/124WOY4iBXxv_9eBXsoHJVUzX98x2sxYy/view?usp=sharing','test.por',overwrite=T)
    dta <- haven::read_por('test.por')
    

    【讨论】:

      猜你喜欢
      • 2018-07-19
      • 2020-05-01
      • 1970-01-01
      • 2018-05-30
      • 2021-03-25
      • 2018-12-20
      • 2020-12-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多