ropensci / taxa

taxonomic classes for R
https://docs.ropensci.org/taxa
Other
48 stars 12 forks source link

`mutate_obs`: create new vector/table/list if `target` is unknown #121

Closed zachary-foster closed 6 years ago

zachary-foster commented 6 years ago

Curerntly, mutate_obs can only add columns to tables. I often want to create a variable for plotting that has per-taxon values, but there is not a per-taxon value table, so I cannot add it with mutate_obs.

If target is not present the following could happen:

Thoughts @sckott?

sckott commented 6 years ago

That seems reasonable to me.

Does taxmap already know how to deal with a standalone vector, e.g., in your first example abovee there's a new vector - is it clear how to map that to the taxa ?

zachary-foster commented 6 years ago

That seems reasonable to me.

Nice

Does taxmap already know how to deal with a standalone vector, e.g., in your first example abovee there's a new vector - is it clear how to map that to the taxa ?

Yea, it knows how to deal with tables, lists, and vectors, although I usually work with tables so lists and vectors are less well debugged.