Description Usage Arguments Value See Also Examples
The functions lama_rename()
and lama_rename_()
are used to rename one or more variable translations inside of a
lama_dictionary class object.
The function lama_rename()
uses non-standard evaluation,
whereas lama_rename_()
is the standard evaluation alternative.
1 2 3 4 5 6 7 8 9 | lama_rename(.data, ...)
## S3 method for class 'lama_dictionary'
lama_rename(.data, ...)
lama_rename_(.data, old, new)
## S3 method for class 'lama_dictionary'
lama_rename_(.data, old, new)
|
.data |
A lama_dictionary object, holding the variable translations |
... |
One or more unquoted expressions separated by commas. Use named arguments, e.g. |
old |
A character vector holding the names of the variable translations, that should be renamed. |
new |
A character vector holding the new names of the variable translations. |
The updated lama_dictionary class object.
lama_translate()
, lama_to_factor()
, lama_translate_all()
,
lama_to_factor_all()
, new_lama_dictionary()
,
as.lama_dictionary()
, lama_select()
, lama_mutate()
,
lama_merge()
, lama_read()
, lama_write()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # initialize lama_dictinoary
dict <- new_lama_dictionary(
country = c(uk = "United Kingdom", fr = "France", NA_ = "other countries"),
language = c(en = "English", fr = "French"),
result = c("1" = "Very good", "2" = "Good", "3" = "Not so good")
)
## Example-1: Usage of 'lama_rename'
# rename translations 'result' and 'language' to 'res' and 'lang'
dict_new <- lama_rename(dict, res = result, lang = language)
dict_new
## Example-2: Usage of 'lama_rename_'
# rename translations 'result' and 'language' to 'res' and 'lang'
dict_new <- lama_rename_(dict, c("result", "language"), c("res", "lang"))
dict_new
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.