Open zachary-foster opened 7 years ago
Partly implemented. Works in Taxonomy
objects, but will simply stop with error if variables not of the same length - Doesn't work with current ex_taxmap
dataset.
Fix this in next cran push
I think that is fine. It works if you pick vars from the same table:
ex_taxmap$get_data_frame(c("n_legs", "dangerous"))
# A tibble: 6 x 2
n_legs dangerous
* <dbl> <lgl>
1 4 TRUE
2 4 FALSE
3 4 FALSE
4 2 TRUE
5 0 FALSE
6 0 FALSE
At least that works 😄
Thinking about this more, I am not sure it makes sense to try to make tabular output for taxmap
that includes multiple user-defined datasets, since we cant know how these data sets relate to eachother. For taxonomy
, all the per-taxon data in get_data
would work. For one tabular/vector dataset in a taxmap
object, it could return the tabular of the taxonomy
part of the object merged with the target data set.
This would try to pack all the information in
taxmap
ortaxonomy
into a table, repeating values when necessary. This could be done using the output ofget_data()
.cols
would be any set of values inall_names()
. I hesitate to havecols
output everything by default, because there is a lot inall_names()
that most people would not want exported (e.g.is_stem
). I also don't want to choose for the user a default set of columns because, in the case oftaxmap
, most of the interesting stuff will be user-defined. So I am thinking have not default and make the user decide what to export.