get_shareable_link_to_data: Get an immediately shareable / pasteable link to data

Description Usage Arguments Details Value Examples

View source: R/data.R

Description

Uploads a data frame to Google Drive, make it shareable, and copies the shareable link onto the clipboard. Requires that OAuth has been set up. googledrive should help you through this if you haven't set OAuth up already.

Usage

1

Arguments

data

A data frame, tibble or other object that be written to a CSV.

path

What to call the data file, as a character. Can also be a file path for more precise placement of the data file. Path must exist both locally and in Google Drive (really, I'm not sure what happens when it doesn't).

direct

If TRUE, the link can be used immediately in R to read in the file. If FALSE, the link is not directly to the CSV, but to the Google Drive preview of the file, which allows for nice previewing of the data.

Details

Creates an intermediate local CSV that is deleted after upload is complete.

Value

Invisibly returns the link as a character vector.

Examples

1
2
3
4
5
6
7
# link for direct download / immediate use
lnk <- get_shareable_link_to_data(mtcars, "mtcars.csv")
mt <- read.csv(lk)
head(mt)

# link to nice preview
get_shareable_link_to_data(mtcars, "mtcars.csv", direct = FALSE)

alexpghayes/hayeslib documentation built on May 5, 2019, 4:47 p.m.