Open alexpghayes opened 6 years ago
Good idea!
I think it would be interesting to hash this out in the company of:
The common theme seems to be "local data frame" <--> "csv on Google Drive" and making the intermediate local file fade into the background or be unnecessary.
I don't know enough about googledrive
to understand what's most idiomatic here. Any guidance?
More than anything the takeaway that I want is a link that I can copy-paste directly into a chat, email or Github issue to avoid the hassle of figuring out how to actually upload a data frame somewhere.
Might also be worth uploading files to a /.auto_uploads/
folder or similar. In my experimentation, it was pretty easy to accidentally fill my main Drive folder with tons of garbage / redundant data sets.
Did you have trouble with uploading multiple things with the same name? Drive lets you do that.
No trouble with multiple uploads. I have like 28 copies of mtcars.csv
in my Drive right now.
Yeah I meant ... are you unhappy with that situation?
In #230 (Consistent naming and overwrite for drive_upload), there is a discussion about workflow when user wants to upload to a file path that already exists. Right now, we cheerfully and silently upload a new file with a replicated name, because that's how Drive works.
But most people don't mean to do this and it makes it hard for them to distinguish their 28 files with the same name but potentially different contents.
This will come up here too.
Ah, gotcha. What about an option overwrite
that defaults to TRUE
?
Then if overwrite = TRUE
and path = "mtcars.csv"
, but there are already 2+ files names mtcars.csv
, give an informative error, since it won't be clear which file to overwrite.
Not at all a comprehensive solution, but I put together a package this morning to address part of the "local data frame" <--> "csv on Google Drive" workflow that @jennybc and Issue #81 mentioned. This package supplies a grab_data
function that is a wrapper around drive_download
and some tempfile pushings-around that takes in a URL to a .csv
, .Rda
, or Google Sheets file and outputs a tibble!
I've been using the following for a little while to quickly share small datasets via Google Drive.
Would love to submit a PR, not sure about the best final form for this:
When
direct = TRUE
, the link can be immediately used inread_csv()
. Whendirect = FALSE
, the link send users to the Google Drive preview of the data.