Read data via the exportcsv link

This function reads all data from a worksheet and returns it as a tbl_df or data.frame. Don't be spooked by the "csv" thing -- the data is NOT actually written to file during this process. Data is read from the "maximal data rectangle", i.e. the rectangle spanned by the maximal row and column extent of the data. By default, empty cells within this rectangle will be assigned NA. This is the fastest method of data consumption, so use it as long as you can tolerate the lack of control re: which cells are being read.

gs_read_csv(ss, ws = 1, ..., verbose = TRUE)

a registered Google spreadsheet, i.e. a googlesheet object


positive integer or character string specifying index or title, respectively, of the worksheet


Optional arguments to control data download, parsing, and reshaping; for most purposes, the defaults should be fine. Anything that is not listed here will be silently ignored.


Logical. Whether to display download progress if in an interactive session.


Seize control of type conversion for variables. Passed straight through to readr::read_csv or readr::type_convert. Follow those links or read the vignette("column-types") for details.

locale, trim_ws, na

Specify locale, the fate of leading or trailing whitespace, or a character vector of strings that should become missing values. Passed straight through to readr::read_csv or readr::type_convert.

comment, skip, n_max

Specify a string used to identify comments, request to skip lines before reading data, or specify the maximum number of data rows to read.


Either TRUE, FALSE or a character vector of column names. If TRUE, the first row of the data rectangle will be used for names. If FALSE, column names will be X1, X2, etc. If a character vector, it will be used as column names. If the sheet contains column names and you just don't like them, specify skip = 1 so they don't show up in your data.


Logical. Whether to run column names through make.names with unique = TRUE, just like read.table does. By default, googlesheets implements the readr data ingest philosophy, which leaves column names "as is", with one exception: data frames returned by googlesheets will have a name for each variable, even if we have to create one.


logical; do you want informative messages?


a data.frame or, if dplyr is loaded, a tbl_df

See Also

Other data consumption functions: gs_read_cellfeed, gs_read_listfeed, gs_read, gs_reshape_cellfeed, gs_simplify_cellfeed

  • gs_read_csv
gap_ss <- gs_gap() # register the Gapminder example sheet
oceania_csv <- gs_read_csv(gap_ss, ws = "Oceania")

## crazy demo of passing args through to readr::read_csv()
oceania_crazy <- gs_read_csv(gap_ss, ws = "Oceania",
  col_names = paste0("Z", 1:6), na = "1962", col_types = "cccccc", skip = 1)
# }
Documentation reproduced from package googlesheets, version 0.3.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.