PD
v = c(FALSE, FALSE, TRUE)
as.numeric(v)
# 0 0 1
Size: a a a
PD
v = c(FALSE, FALSE, TRUE)
as.numeric(v)
# 0 0 1
VK
VK
VK
AS
AS
VK
AS
VK
AS
Column specification
Column types must be specified in a single string of readr-style short codes, e.g. "cci?l" means "character, character, integer, guess, logical". This is not where googlesheets4's col spec will end up, but it gets the ball rolling in a way that is consistent with readr and doesn't reinvent any wheels.
Shortcodes for column types:
_ or -: Skip. Data in a skipped column is still requested from the API (the high-level functions in this package are rectangle-oriented), but is not parsed into the data frame output.
?: Guess. A type is guessed for each cell and then a consensus type is selected for the column. If no atomic type is suitable for all cells, a list-column is created, in which each cell is converted to an R object of "best" type. If no column types are specified, i.e. col_types = NULL, all types are guessed.
l: Logical.
i: Integer. This type is never guessed from the data, because Sheets have no formal cell type for integers.
d or n: Numeric, in the sense of "double".
D: Date. This type is never guessed from the data, because date cells are just serial datetimes that bear a "date" format.
t: Time of day. This type is never guessed from the data, because time cells are just serial datetimes that bear a "time" format. Not implemented yet; returns POSIXct.
T: Datetime, specifically POSIXct.
c: Character.
C: Cell. This type is unique to googlesheets4. This returns raw cell data, as an R list, which consists of everything sent by the Sheets API for that cell. Has S3 type of "CELL_SOMETHING" and "SHEETS_CELL". Mostly useful internally, but exposed for those who want direct access to, e.g., formulas and formats.
L: List, as in "list-column". Each cell is a length-1 atomic vector of its discovered type.
Still to come: duration (code will be :) and factor (code will be f).
VK
O
ЕТ
O
ЕТ
VK
FA
ЕТ
iconv("é", toRaw = TRUE)
FA
PU