Given a vector of names, return a list of data (usually lists/vectors) contained in a taxonomy() or taxmap() object. Each item will be named by taxon ids when possible.

obj$get_data(name = NULL, ...)
get_data(obj, name = NULL, ...)

Arguments

obj

A taxonomy() or taxmap() object

name

(character) Names of data to return. If not supplied, return all data listed in all_names().

...

Passed to all_names(). Used to filter what kind of data is returned (e.g. columns in tables or function output?) if name is not supplied or what kinds are allowed if name is supplied.

Value

list of vectors or lists. Each vector or list will be named by associated taxon ids if possible.

See also

Other NSE helpers: all_names(), data_used, names_used

Examples

# Get specific values get_data(ex_taxmap, c("reaction", "n_legs", "taxon_ranks"))
#> $reaction #> [1] "Watch out! That tiger might attack!" "No worries; its just a cat." #> [3] "No worries; its just a mole." "Watch out! That human might attack!" #> [5] "No worries; its just a tomato." "No worries; its just a potato." #> #> $n_legs #> m n o p q r #> 4 4 4 2 0 0 #> #> $taxon_ranks #> b c d e f g h i #> "class" "kingdom" "family" "family" "family" "family" "genus" "genus" #> j k l m n o p q #> "genus" "genus" "genus" "species" "species" "species" "species" "species" #> r #> "species" #>
# Get all values get_data(ex_taxmap)
#> $taxon_names #> b c d e f #> "Mammalia" "Plantae" "Felidae" "Notoryctidae" "Hominidae" #> g h i j k #> "Solanaceae" "Panthera" "Felis" "Notoryctes" "homo" #> l m n o p #> "Solanum" "tigris" "catus" "typhlops" "sapiens" #> q r #> "lycopersicum" "tuberosum" #> #> $taxon_ids #> b c d e f g h i j k l m n o p q r #> "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" #> #> $taxon_indexes #> b c d e f g h i j k l m n o p q r #> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #> #> $classifications #> b #> "Mammalia" #> c #> "Plantae" #> d #> "Mammalia;Felidae" #> e #> "Mammalia;Notoryctidae" #> f #> "Mammalia;Hominidae" #> g #> "Plantae;Solanaceae" #> h #> "Mammalia;Felidae;Panthera" #> i #> "Mammalia;Felidae;Felis" #> j #> "Mammalia;Notoryctidae;Notoryctes" #> k #> "Mammalia;Hominidae;homo" #> l #> "Plantae;Solanaceae;Solanum" #> m #> "Mammalia;Felidae;Panthera;tigris" #> n #> "Mammalia;Felidae;Felis;catus" #> o #> "Mammalia;Notoryctidae;Notoryctes;typhlops" #> p #> "Mammalia;Hominidae;homo;sapiens" #> q #> "Plantae;Solanaceae;Solanum;lycopersicum" #> r #> "Plantae;Solanaceae;Solanum;tuberosum" #> #> $n_supertaxa #> b c d e f g h i j k l m n o p q r #> 0 0 1 1 1 1 2 2 2 2 2 3 3 3 3 3 3 #> #> $n_supertaxa_1 #> b c d e f g h i j k l m n o p q r #> 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 #> #> $n_subtaxa #> b c d e f g h i j k l m n o p q r #> 11 4 4 2 2 3 1 1 1 1 2 0 0 0 0 0 0 #> #> $n_subtaxa_1 #> b c d e f g h i j k l m n o p q r #> 3 1 2 1 1 1 1 1 1 1 2 0 0 0 0 0 0 #> #> $n_leaves #> b c d e f g h i j k l m n o p q r #> 4 2 2 1 1 2 1 1 1 1 2 0 0 0 0 0 0 #> #> $n_leaves_1 #> b c d e f g h i j k l m n o p q r #> 0 0 0 0 0 0 1 1 1 1 2 0 0 0 0 0 0 #> #> $taxon_ranks #> b c d e f g h i #> "class" "kingdom" "family" "family" "family" "family" "genus" "genus" #> j k l m n o p q #> "genus" "genus" "genus" "species" "species" "species" "species" "species" #> r #> "species" #> #> $is_root #> b c d e f g h i j k l m n #> TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> o p q r #> FALSE FALSE FALSE FALSE #> #> $is_stem #> b c d e f g h i j k l m n #> FALSE TRUE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> o p q r #> FALSE FALSE FALSE FALSE #> #> $is_branch #> b c d e f g h i j k l m n #> FALSE FALSE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE FALSE FALSE #> o p q r #> FALSE FALSE FALSE FALSE #> #> $is_leaf #> b c d e f g h i j k l m n #> FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE #> o p q r #> TRUE TRUE TRUE TRUE #> #> $is_internode #> b c d e f g h i j k l m n #> FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE #> o p q r #> FALSE FALSE FALSE FALSE #> #> $n_obs #> b c d e f g h i j k l m n o p q r #> 4 2 2 1 1 2 1 1 1 1 2 1 1 1 1 1 1 #> #> $n_obs_1 #> b c d e f g h i j k l m n o p q r #> 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 #> #> $name #> m n o p q r #> "tiger" "cat" "mole" "human" "tomato" "potato" #> #> $n_legs #> m n o p q r #> 4 4 4 2 0 0 #> #> $dangerous #> m n o p q r #> TRUE FALSE FALSE TRUE FALSE FALSE #> #> $code #> m n o p m n o p #> T C M H T C M H #> Levels: C H M T #> #> $sample_id #> m n o p m n o p #> A A B B A A B B #> Levels: A B #> #> $count #> m n o p m n o p #> 1 2 5 2 6 2 4 0 #> #> $taxon_index #> m n o p m n o p #> 1 2 3 4 1 2 3 4 #> #> $phylopic_ids #> m n #> "e148eabb-f138-43c6-b1e4-5cda2180485a" "12899ba0-9923-4feb-a7f9-758c3c7d5e13" #> o p #> "11b783d5-af1c-4f4e-8ab5-a51470652b47" "9fae30cd-fb59-4a81-a39c-e1826a35f612" #> q r #> "b6400f39-345a-4711-ab4f-92fd4e22cb1a" "63604565-0406-460b-8cb8-1abe954b3f3a" #> #> $foods #> $foods$m #> [1] "mammals" "birds" #> #> $foods$n #> [1] "cat food" "mice" #> #> $foods$o #> [1] "insects" #> #> $foods$p #> [1] "Most things, but especially anything rare or expensive" #> #> $foods$q #> [1] "light" "dirt" #> #> $foods$r #> [1] "light" "dirt" #> #> #> $reaction #> [1] "Watch out! That tiger might attack!" "No worries; its just a cat." #> [3] "No worries; its just a mole." "Watch out! That human might attack!" #> [5] "No worries; its just a tomato." "No worries; its just a potato." #>