spread_sheet | R Documentation |
Reshapes a data frame of cells (presumably the output of
range_read_cells()
) into another data frame, i.e., puts it back into the
shape of the source spreadsheet. This function exists primarily for internal
use and for testing. The flagship function range_read()
, a.k.a.
read_sheet()
, is what most users are looking for. It is basically
range_read_cells()
+ spread_sheet()
.
spread_sheet(
df,
col_names = TRUE,
col_types = NULL,
na = "",
trim_ws = TRUE,
guess_max = min(1000, max(df$row)),
.name_repair = "unique"
)
df |
A data frame with one row per (nonempty) cell, integer variables
|
col_names |
|
col_types |
Column types. Either |
na |
Character vector of strings to interpret as missing values. By default, blank cells are treated as missing data. |
trim_ws |
Logical. Should leading and trailing whitespace be trimmed from cell contents? |
guess_max |
Maximum number of data rows to use for guessing column types. |
.name_repair |
Handling of column names. By default, googlesheets4
ensures column names are not empty and are unique. There is full support
for |
A tibble in the shape of the original spreadsheet, but enforcing
user's wishes regarding column names, column types, NA
strings, and
whitespace trimming.
df <- gs4_example("mini-gap") %>%
range_read_cells()
spread_sheet(df)
# ^^ gets same result as ...
read_sheet(gs4_example("mini-gap"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.