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

taxa_nest #16

Closed
bibsian opened this issue Mar 3, 2017 · 5 comments
Closed

taxa_nest #16

bibsian opened this issue Mar 3, 2017 · 5 comments
Assignees

Comments

@bibsian
Copy link
Collaborator

bibsian commented Mar 3, 2017

Remove "shrink" argument form elastic tab.

Write unit test too.

@AldoCompagnoni
Copy link
Contributor

Shrink removed

@bochocki
Copy link
Contributor

Reopening because 1) elastic_tab() is causing some issues, and 2) it's not clear whether the unit test was written.

In browse(), the call to elastic_tab() was originally placed after the vars section (where the user's input could determine which columns to return). This had the (unintended?) consequence of preventing the user from deciding whether or not to return taxonomy; the column was always there, regardless of what the user specified.

  • Moved this call to before the vars section.
  • Added "taxonomy" to possible_args() so that "taxonomy" does not fail the err_full_tab() test.
  • Added "taxonomy" to the err_full_tab() call; since it's not in the main table, a user calling vars=taxonomy would get an error message.

elastic_tab() also seems to collapse all of the taxonomy columns (e.g. "species", "genus", etc) so they do not appear in the full table, even when the full table is specified. This seems to be the intended function, so for now I've commented all taxonomic names out of the possible_args() function so that things get returned properly.

Finally, something in elastic_tab() seems to be changing the table output from browse() in a way I didn't expect. Calling browse(structure == "size", full_tbl = F) returns a dataframe with dimensions [2824 x 17], but calling browse(structure == "size", full_tbl = T) returns a dataframe with dimensions [54 x 61]. The difference in columns was expected, but the difference in rows seems strange to me. I've isolated it to elastic_tab(), but am not sure whether or not this is the intended behavior.

bochocki added a commit that referenced this issue Mar 12, 2017
Changed the order that functions executed to get vars working. As a consequence, I had to include "taxonomy" in a lot of the code, which is created by elastic_tab() and was causing problems.

Details on changes to vars are here: 
Details on changes to elastic_tab() related issues are here: #16 (comment)
@AldoCompagnoni
Copy link
Contributor

AldoCompagnoni commented Mar 16, 2017

I shall note that Brad points out a conflict that could turn up in 5 different ways. I provide sample code for these 5 scenarios. I provide sample code where I define two types of vars in browse: one non-taxonomic variable, proj_metadata_key, and taxonomic variables:

  1. browse(vars=c("proj_metadata_key")): no taxonomy list provided
  2. browse(vars=c("proj_metadata_key","genus"): taxonomy list includes "genus" only
  3. browse(vars=c("proj_metadata_key", "taxonomy"), full_tbl=F): "small" taxonomy list provided
  4. browse(vars=c("proj_metadata_key", "taxonomy"), full_tbl=T): "large" taxonomy list provided
  5. browse(vars=c("proj_metadata_key","genus","taxonomy")): here, "taxonomy" overrides "genus", so that taxonomy includes all the variables of the "small" taxonomy list (default is full_tbl = F).

@AldoCompagnoni AldoCompagnoni changed the title Elastic tab function taxa_nest Apr 3, 2017
@AldoCompagnoni
Copy link
Contributor

Here is how attempted to solve this issue.

  1. when vars = "proj_metadata_key", browse reports only that column
  2. same thing when vars = c("proj_metadata_key","lterid": there is not "list column" with taxas
  3. when only one taxonomic variable is specified (e.g. vars = "genus"), browse reports a list column whose name refers to the specified variable (e.g. "genus")
  4. when more than one taxonomic variable is specified, then those variables go under a list column named "taxas".

@AldoCompagnoni
Copy link
Contributor

Look up issue #14: if my solution above is considered viable, then we'll close both issues.

@levisc8 levisc8 closed this as completed Jun 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants