Download Google Sheets Using Just the URL

Simple package to download Google Sheets using just the sharing link. Spreadsheets can be downloaded as a data frame, or as plain text to parse manually. Google Sheets is the new name for Google Docs Spreadsheets < https://www.google.com/sheets/about>.


gsheet

CRAN_Status_Badge R-CMD-check

gsheet is a simple package to download [Google Sheets](https://www.google.com/sheets/about/ (aka Google Docs Spreadsheets) using just the sharing link. Sheets can be downloaded as a data frame, or as plain text to parse manually.

Installation

Install from CRAN with:

install.packages('gsheet')

Or install the latest development version from github with:

devtools::install_github("maxconway/gsheet")

Getting started

Download a google sheet as a table with:

library(gsheet)
gsheet2tbl('docs.google.com/spreadsheets/d/1I9mJsS5QnXF2TNNntTy-HrcdHmIF9wJ8ONYvEJTXSNo')

Advanced

More control

If you want more control, you might want to use something like:

url <- 'docs.google.com/spreadsheets/d/1I9mJsS5QnXF2TNNntTy-HrcdHmIF9wJ8ONYvEJTXSNo'
a <- gsheet2text(url, format='csv')
b <- read.csv(a, stringsAsFactors=FALSE)

This way the table can be cleaned before parsing, and different options can be used in parsing.

Downloading other sheets

If you want to download a sheet other than the first, you have to use the direct url, copied from the address bar, like so:

url <- 'docs.google.com/spreadsheets/1I9mJsS5QnXF2TNNntTy-HrcdHmIF9wJ8ONYvEJTXSNo#gid=850032961'
b <- gsheet2tbl(url)

This works because this makes the gid, which is the sheet identifier, available. If you have problems downloading the first sheet, this can also help too.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("gsheet")

0.4.6 by Max Conway, 2 years ago


https://github.com/maxconway/gsheet


Report a bug at https://github.com/maxconway/gsheet/issues


Browse source code at https://github.com/cran/gsheet


Authors: Max Conway [aut, cre]


Documentation:   PDF Manual  


GPL-3 license


Imports httr, stringr

Suggests testthat, readr


Imported by gfer, odk.

Suggested by GerminaR, geoflow, huito, inti, rdwd.


See at CRAN