0

I have a Dropbox folder with compressed JSON files in tar.gz, how can I extract the files, unzip them and read them in R? Could readtext from the readtext package help me, and how can I use the source argument of the function to access the folder?

I've tried creating tempfiles and download.file, and applying untar, but it returns an error code 1

r2evans
  • 141,215
  • 6
  • 77
  • 149
  • 2
    This is two(+) different questions. (1) **"How to access files in dropbox?"** For this, I found several good references in [`cran dropbox`](https://www.google.com/search?q=cran+dropbox) (in google). I don't use any of them, no endorsements or recommendations. (2) **"How to read json files in `.tar.gz` archives?"** I suggest taking cues from https://stackoverflow.com/a/7151322/3358272. (It seems likely you'll have to save the tarballed json file to a local (temp) file before reading it in, not certain if that's possible.) Possibly (3): **"How to read JSON?"** Use `jsonlite`. – r2evans Dec 02 '22 at 16:14
  • BTW, the Stack tag-recommendation system is imperfect. Please review the tags when you ask questions, as it often gets things horribly wrong. For example, [tag:dbi] and [tag:sqlite] have _nothing_ to do with your question, at least not given the context we see so far. I'm recommending an edit to remove them, please be more aware of this in future questions. Thanks! – r2evans Dec 02 '22 at 16:16

0 Answers0