grab_data: Load a drive file into a dataframe

Description Usage Arguments Examples

View source: R/grab_data.R

Description

This function grabs a dataset from Google Drive and returns it as an R dataframe object. You might need to run 'drive_auth()' before running this to get your Google account credentials set up.

Usage

1
grab_data(url, filetype, ...)

Arguments

url

The link to the desired file obtained by "get shareable link" (the user must have at least viewing access to the file). Can be either a '.csv', Google Sheets, or '.Rda' file.

filetype

A character vector specifying the filetype. Either "csv", "Sheet", or "Rda".

...

Additional arguments to supply to 'read_csv()'.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# Grab a very useful dataset
grab_data(url = "https://drive.google.com/open?id=1JnkQddF8FmY0YsXZSWBanQNPjZ_LBIQUGi_s43vNDIQ",
          filetype = "Sheet")

# Send extra arguments to read_csv
grab_data("https://drive.google.com/file/d/10j5nM5Wu27S5-kIsf1x6HlkLpOKvcqhE/view?usp=sharing",
          "csv",
          col_types = cols(compelling_narrative = col_character(),
                           index = col_integer()))

## End(Not run)

simonpcouch/googledriveplus documentation built on Nov. 5, 2019, 8:55 a.m.