1

Following this answer, I'm trying to read a .por file into R via a shareable link (https://drive.google.com/file/d/124WOY4iBXxv_9eBXsoHJVUzX98x2sxYy/view?usp=sharing) without success (using haven package):

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

Is this fixable?

Tried the following:

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

dta <- haven::read_por(j)
rnorouzian
  • 7,397
  • 5
  • 27
  • 72

1 Answers1

0

You could use googledrive package to download the file first:

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')
Waldi
  • 39,242
  • 6
  • 30
  • 78