selectFromList | R Documentation |
Select variables from a list of objects of the same type
selectFromList(x, select)
x |
A list of objects of the same type. |
select |
A character vector of names of variables to select. |
x <- list(
a = list(name = "John", age = 25, gender = "M"),
b = list(name = "Mary", age = 24, gender = "F")
)
selectFromList(x, c("name", "age"))
# $a
# $a$name
# [1] "John"
#
# $a$age
# [1] 25
#
#
# $b
# $b$name
# [1] "Mary"
#
# $b$age
# [1] 24
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.