Simplify data from the "cell feed"
In some cases, you do not want to convert the data retrieved from the cell
feed into a data frame via gs_reshape_cellfeed
. Instead, you
want the data as an atomic vector. That's what this function does. Note that,
unlike gs_reshape_cellfeed
, embedded empty cells will NOT
necessarily appear in this result. By default, the API does not transmit data
for these cells; googlesheets
inserts these cells in
gs_reshape_cellfeed
because it is necessary to give the data
rectangular shape. In contrast, empty cells will only appear in the output of
gs_simplify_cellfeed
if they were already present in the data from the
cell feed, i.e. if the original call to gs_read_cellfeed
had
argument return_empty
set to TRUE
.
gs_simplify_cellfeed(x, convert = TRUE, literal = TRUE, locale = NULL, trim_ws = NULL, na = NULL, notation = c("A1", "R1C1", "none"), col_names = NULL)
x |
a data frame returned by |
convert |
logical. Indicates whether to attempt to convert the result
vector from character to something more appropriate, such as logical,
integer, or numeric. If |
literal |
logical, indicating whether to work only with literal values returned by the API or to consult alternate cell contents |
locale, trim_ws, na |
Optionally, specify locale, the fate of leading or
trailing whitespace, or a character vector of strings that should become
missing values. Passed straight through to
|
notation |
character. The result vector can have names that reflect which cell the data came from; this argument selects between the "A1" and "R1C1" positioning notations. Specify "none" to suppress names. |
col_names |
if |
a vector
Other data consumption functions: gs_read_cellfeed
,
gs_read_csv
,
gs_read_listfeed
, gs_read
,
gs_reshape_cellfeed
## Not run: gap_ss <- gs_gap() # register the Gapminder example sheet (gap_cf <- gs_read_cellfeed(gap_ss, range = cell_rows(1))) gs_simplify_cellfeed(gap_cf) gs_simplify_cellfeed(gap_cf, notation = "R1C1") (gap_cf <- gs_read_cellfeed(gap_ss, range = "A1:A10")) gs_simplify_cellfeed(gap_cf) gs_simplify_cellfeed(gap_cf, col_names = FALSE) ff_ss <- gs_ff() # register example sheet with formulas and formatted nums ff_cf <- gs_read_cellfeed(ff_ss, range = cell_cols(3)) gs_simplify_cellfeed(ff_cf) # rounded to 2 digits gs_simplify_cellfeed(ff_cf, literal = FALSE) # hello, more digits! ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.