lets.transf | R Documentation |
Transform each element of a vector.
lets.transf(x, y, z, NUMERIC = TRUE)
x |
A vector to be transformed. |
y |
levels to be transformed. |
z |
The value to be atributed to each level (same order as y). |
NUMERIC |
logical, if |
Return a vector with changed values.
Bruno Vilela
## Not run:
status <- sample(c("EN","VU", "NT", "CR", "DD", "LC"), 30, replace=TRUE)
TE <- "Threatened"
NT <- "Non-Threatened"
new <- c(TE, TE, NT, TE, "Data Deficient", NT)
old <- c("EN","VU", "NT", "CR", "DD", "LC")
statustrans <- lets.transf(status, old, new, NUMERIC=FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.