| as_mmm | R Documentation |
extended modeFunctions to coerce objects to base mode or extended mode.
as_mmm(x, mode, levs = NULL, na = FALSE)
as_chr(x, na = FALSE)
as_clr(x, na = FALSE)
as_fun(x)
as_int(x)
as_num(x)
as_lgl(x)
as_ord(x, levs)
as_uno(x, levs)
x |
For |
mode |
A threechar scalar containing an extended mode value. |
levs |
Optional complete atomic vec of factor levels (ordered factor levels for |
na |
|
Functions in this family are as follows:
as_chr | Thinly wraps as.character. |
as_int | Thinly wraps as.integer. |
as_num | Thinly wraps as.numeric. |
as_lgl | Thinly wraps as.logical. |
as_ord | As extended mode 'ord' (ordered factor). Wraps factor(x, levels = levs, ordered = TRUE). |
as_uno | As extended mode 'uno' (unordered factor). Wraps factor(x, levels = levs, ordered = FALSE). |
as_clr | Coerces character color values to hexadecimal. |
as_fun | If x is a character scalar function return that function, but if x is a function object, return it. |
An object of base mode 'character'
as_chr
An object of base mode 'integer'
as_int
An object of base mode 'logical'
as_lgl
An object of base mode 'numeric'
as_num
An object of extended mode 'ord' (ordered factor)
as_ord
An object of extended mode 'uno' (unordered factor)
as_uno
An object of extended mode 'clr' (hex color in form '#RRGGBBAA')
as_clr
Other properties:
bbb_ccc_help(),
bbb_help(),
bbb_mmm_prop_funs(),
ccc_help(),
cls(),
cmp_ccc_help(),
cmp_mmm_ccc_help(),
cmp_mmm_help(),
compatible(),
ddd_prop_funs(),
eee_help(),
iii_help(),
meets(),
mmm_ccc_help(),
mmm_help(),
ppp_fast_help(),
ppp_help(),
sss_ccc_help(),
sss_prop_funs(),
unq_ccc_prop_funs(),
unq_mmm_ccc_help(),
unq_mmm_help()
bins. <- sample(c(0, 1), 10, replace = T)
chrs. <- c("3.14", "2.72", "1.41")
clrs. <- c("red", "#AABBCC", "#AABBCCDD", "blue")
nums. <- c(pi, exp(1), sqrt(2))
as_fun(unique)
as_fun("unique")
bins.
as_lgl(bins.)
chrs.
as_num(chrs.)
as_int(chrs.)
clrs.
as_clr(clrs.)
nums.
as_chr(nums.)
as_uno(clrs., levs = unique(clrs.))
as_ord(clrs., levs = sort(unique(clrs.)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.