gs_reshape_cellfeed

0th

Percentile

Reshape data from the "cell feed"

Reshape data from the "cell feed", put it in a tbl_df, and do type conversion. By default, assuming we're working with the same cells, gs_reshape_cellfeed should return the same result as other read functions. But when literal = FALSE, something different happens: we attempt to deliver cell contents free of any numeric formatting. Try this if numeric formatting of literal values is causing numeric data to come in as character, to be undesirably rounded, or to be otherwise mangled. Remember you can also control type conversion by using ... to provide arguments to readr::type_convert. See the vignette("formulas-and-formatting") for more details.

Usage
gs_reshape_cellfeed(x, literal = TRUE, ..., verbose = TRUE)
Arguments
x

a data frame returned by gs_read_cellfeed

literal

logical, indicating whether to work only with literal values returned by the API or to consult alternate cell contents

...

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.

progress

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

col_types

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.

col_names

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.

check.names

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.

verbose

logical; do you want informative messages?

Value

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

See Also

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

Aliases
  • gs_reshape_cellfeed
Examples
# NOT RUN {
gap_ss <- gs_gap() # register the Gapminder example sheet
gs_read_cellfeed(gap_ss, "Asia", range = cell_rows(1:4))
gs_reshape_cellfeed(gs_read_cellfeed(gap_ss, "Asia", range = cell_rows(1:4)))
gs_reshape_cellfeed(gs_read_cellfeed(gap_ss, "Asia",
                                     range = cell_rows(2:4)),
                    col_names = FALSE)
gs_reshape_cellfeed(gs_read_cellfeed(gap_ss, "Asia",
                                     range = cell_rows(2:4)),
                    col_names = paste0("yo", 1:6))

ff_ss <- gs_ff() # register example sheet with formulas and formatted nums
ff_cf <- gs_read_cellfeed(ff_ss)
gs_reshape_cellfeed(ff_cf) # almost all vars are character
gs_reshape_cellfeed(ff_cf, literal = FALSE) # more vars are numeric
# }
Documentation reproduced from package googlesheets, version 0.3.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.