as_reliable {hablar} | R Documentation |
Reliable conversion to another data type
Description
Support functions for the convert
function. These functions coerces vectors to a new data type, e.g. as.numeric
except that it converts factors to character first.
See convert
for more information.
Usage
as_reliable_num(.x, ...)
as_reliable_int(.x, ...)
as_reliable_lgl(.x, ...)
as_reliable_dte(.x, origin = "1970-01-01", ...)
as_reliable_dtm(.x, origin = "1970-01-01", tz = "UTC", ...)
as_reliable_int(.x, ...)
as_reliable_lgl(.x, ...)
as_reliable_dte(.x, origin = "1970-01-01", ...)
as_reliable_dtm(.x, origin = "1970-01-01", tz = "UTC", ...)
Arguments
.x |
vector |
... |
additional arguments |
origin |
argument to set origin for date/date time. |
tz |
argument to set time zone for date/date time. Default is UTC. |
Value
vector
See Also
vignette("convert")
, vignette("hablar")
Examples
x <- as.factor(c("1", "3.5"))
as_reliable_num(x)
x <- as.factor(c("9", "7"))
as_reliable_int(x)
x <- as.factor(c("1", "0"))
as_reliable_lgl(x)
[Package hablar version 0.3.2 Index]