Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Download a Stata dataset from Google Drive using "webuse set" or "use http://ur/"

    Dear All,

    I have some frequently used Stata datasets stored at my Google Drive.

    It would be very convenient if it was possible to load these datasets from within Stata, as one does with "webuse set" or "use http://ur/" to use a dataset from Stata or another website.

    One can obtain a direct download from Google Drive through the following link:
    https://drive.google.com/uc?export=download&id=YOUR_FILE_ID .
    However, neither the above procedure seems to be working nor is useful for my purposes.

    I'd rather prefer to do something like:

    webuse set "Gdrive/mydatasets"
    webuse filename, clear


    (where filename is necessarily different from the file_id provided by Google Drive).

    Is that possible?

    Thanks,
    David
    David Leite Neves
    [email protected]

  • #2
    David Leite Neves rather than simply stating that something does not work, it would be more useful/helpful if you provided a reproducible example. Try simulating a simple dataset and then posting that. However, unless the file is set to be publicly available in Google Drive, how would your credentials be passed in the HTTP call in order to retrieve the data? If you are using Google Drive, they also include applications that allow you to map the cloud based disk space to your local file system in which case you could do something like:

    Code:
    use "/Users/billy/Google Drive/theFile.dta", clear
    The file path will differ across operating systems, but the general premise would still be the same.

    Comment


    • #3
      Why not download Google Drive for PC from
      HTML Code:
      https://www.google.com/drive/download/
      and then you can access the files directly from your PC

      Code:
      use "C:\Users\Martyn\Google Drive\colour scores.dta", clear
      Martyn

      Comment


      • #4
        is there a known way of doing what op originally asked?

        Comment


        • #5
          Simone: Please note our preference for full real names here, including family names or surnames.

          Billy and Martyn have already pointed out, explicitly or implicitly, that the original post didn't pose a reproducible problem.

          Similarly, in what precise ways do #2 and #3 not work for you? Indeed, as webuse and webuse set are both existing commands, how does #1 not work for you.

          Comment


          • #6
            Hi Nick thank you for your response. I didn't say the suggested solutions didn't work. I just wanted to know whether there were a solution to the original question

            Comment


            • #7
              Simone
              In the past I have faced the same situation you originally posted (regardless it does not fit Stata forum dress code i get it).

              What I ended up doing was using R routine to read google forms / drive save it in my computer and then use it in a single run.

              Comment

              Working...
              X