Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gs_upload

Upload a file and convert it to a Google Sheet


Description

Google supports the following file types to be converted to a Google spreadsheet: .xls, .xlsx, .csv, .tsv, .txt, .tab, .xlsm, .xlt, .xltx, .xltm, .ods. The newly uploaded file will appear in your Google Sheets home screen. This function calls the Google Drive API.

Usage

gs_upload(file, sheet_title = NULL, verbose = TRUE, overwrite = FALSE)

Arguments

file

path to the file to upload

sheet_title

the title of the spreadsheet; optional, if not specified then the name of the file will be used

verbose

logical; do you want informative messages?

overwrite

whether to overwrite an existing Sheet with the same title

Examples

## Not run: 
write.csv(head(iris, 5), "iris.csv", row.names = FALSE)
iris_ss <- gs_upload("iris.csv")
iris_ss
gs_read(iris_ss)
file.remove("iris.csv")
gs_delete(iris_ss)

## End(Not run)

googlesheets

Manage Google Spreadsheets from R

v0.3.0
MIT + file LICENSE
Authors
Jennifer Bryan [aut, cre], Joanna Zhao [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.