Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function for tabular output of `taxonomy` and `taxmap` #58

Open
zachary-foster opened this issue Jun 2, 2017 · 4 comments
Open

Add function for tabular output of `taxonomy` and `taxmap` #58

zachary-foster opened this issue Jun 2, 2017 · 4 comments
Milestone

Comments

@zachary-foster
Copy link
Collaborator

@zachary-foster zachary-foster commented Jun 2, 2017

This would try to pack all the information in taxmap or taxonomy into a table, repeating values when necessary.
This could be done using the output of get_data().

export_data = function(obj, cols) {
   ...
}

cols would be any set of values in all_names(). I hesitate to have cols output everything by default, because there is a lot in all_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 of taxmap, most of the interesting stuff will be user-defined. So I am thinking have not default and make the user decide what to export.

@zachary-foster zachary-foster added this to the v0.2 milestone Jul 18, 2017
sckott added a commit that referenced this issue Dec 18, 2017
stops now when variables are of unequal length
sckott added a commit that referenced this issue Dec 18, 2017
…/gitignore scott notes md file, bump dev ver
@sckott
Copy link
Member

@sckott sckott commented Dec 18, 2017

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

@sckott sckott modified the milestones: v0.2, v0.3 Dec 18, 2017
@zachary-foster
Copy link
Collaborator Author

@zachary-foster zachary-foster commented Dec 18, 2017

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
@sckott
Copy link
Member

@sckott sckott commented Dec 19, 2017

At least that works 😄

@zachary-foster
Copy link
Collaborator Author

@zachary-foster zachary-foster commented Mar 29, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.