list_rename | R Documentation |
Rename elements of a named list.
list_rename(in_list, ...)
in_list |
The list to rename elements in. |
... |
The renaming definitions. |
'list_rename()' changes the name of elements in a named list. The definitions for renaming are given in '...' in the style 'new_name = old_name'. You can specify as many renaming definitions as you like as long as there are not more definitions than elements in the list.
If no renaming definition is given the input list is returned. If you try to rename elements not present in the list nothing happens; unless you provide more renaming definitions than elements in the list, in that case an error is raised.
The list provided in 'in_list' with elements renamed according to the definition in '...'.
my_list <- list(a = 1, b = 2, c = 3) list_rename(my_list, AAA = "a", CCC = "c")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.