Description Usage Arguments Value See Also Examples
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.
1 | gs_read_csv(ss, ws = 1, ..., verbose = TRUE)
|
ss |
a registered Google spreadsheet, i.e. a |
ws |
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.
|
verbose |
logical; do you want informative messages? |
a data.frame
or, if dplyr
is loaded, a
tbl_df
Other data consumption functions: gs_read_cellfeed
,
gs_read_listfeed
, gs_read
,
gs_reshape_cellfeed
,
gs_simplify_cellfeed
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
gap_ss <- gs_gap() # register the Gapminder example sheet
oceania_csv <- gs_read_csv(gap_ss, ws = "Oceania")
str(oceania_csv)
oceania_csv
## 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)
oceania_crazy
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.