powered by
Cleaner conversion functions
convert x to arbitrary class
chr(x, ...)int(x, ...)dbl(x, ...)num(x, ...)bool(x, ...)as.class(x, class)
int(x, ...)
dbl(x, ...)
num(x, ...)
bool(x, ...)
as.class(x, class)
object to be converted
other args for as. conversion
chatracter name of the class to convert x to
Steven Nydick, steven.nydick@kornferry.com
Ben Wiseman, benjamin.wiseman@kornferry.com
chr(42) # "42" = as.character int(42.1) # 42L = as.integer dbl("42L") # 42.0 = as.double num("42") # 42 = as.numeric bool(42) # TRUE = as.logical foo <- 255 as.class(foo, "roman") # [1] CCLV
Run the code above in your browser using DataLab