Learn R Programming

hablar (version 0.3.0)

as_reliable: 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 = "Europe/London", ...)

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 = "Europe/London", ...)

Value

vector

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 Europe/London.

See Also

vignette("convert"), vignette("hablar")

Examples

Run this code
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)

Run the code above in your browser using DataLab