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

Need non-NSE versions of functions #180

Open
zachary-foster opened this issue Jul 25, 2018 · 0 comments
Open

Need non-NSE versions of functions #180

zachary-foster opened this issue Jul 25, 2018 · 0 comments

Comments

@zachary-foster
Copy link
Collaborator

Occasionally, I run into problems with the NSE in things like filter_taxa, like this:

> obj %>%
+     mutate_obs("tax_prop", sample_prop = obj$data$tax_prop[[sample]]) %>%
+     filter_taxa(obj$data$tax_prop[["X700114488"]] >= 0.001 | obj$data$tax_prop[["X700114430"]] >= 0.001)
Error: `data` must be uniquely named but has duplicate elements
In addition: Warning message:
 Hide Traceback
 
 Rerun with Debug
 Error: `data` must be uniquely named but has duplicate elements 
14.
FUN(X[[i]], ...) 
13.
lapply(rlang::quos(...), rlang::eval_tidy, data = self$data_used(...)) at taxonomy--class.R#1231
12.
private$parse_nse_taxon_subset(...) at taxonomy--class.R#749
11.
obj$filter_taxa(..., subtaxa = subtaxa, supertaxa = supertaxa, 
    drop_obs = drop_obs, reassign_obs = reassign_obs, reassign_taxa = reassign_taxa, 
    invert = invert, keep_order = keep_order) at taxonomy--s3.R#529
10.
filter_taxa.Taxmap(., obj$data$tax_prop[["X700114488"]] >= 0.001 | 
    obj$data$tax_prop[["X700114430"]] >= 0.001) at taxonomy--s3.R#487
9.
filter_taxa(., obj$data$tax_prop[["X700114488"]] >= 0.001 | obj$data$tax_prop[["X700114430"]] >= 
    0.001) 
8.
function_list[[k]](value) 
7.
withVisible(function_list[[k]](value)) 
6.
freduce(value, `_function_list`) 
5.
`_fseq`(`_lhs`) 
4.
eval(quote(`_fseq`(`_lhs`)), env, env) 
3.
eval(quote(`_fseq`(`_lhs`)), env, env) 
2.
withVisible(eval(quote(`_fseq`(`_lhs`)), env, env)) 
1.
obj %>% mutate_obs("tax_prop", sample_prop = obj$data$tax_prop[[sample]]) %>% 
    filter_taxa(obj$data$tax_prop[["X700114488"]] >= 0.001 | 
        obj$data$tax_prop[["X700114430"]] >= 0.001) 

Yet, this works:

  to_use <- obj$data$tax_prop[["X700114488"]] >= 0.001 | obj$data$tax_prop[["X700114430"]] >= 0.001
  obj %>%
    mutate_obs("tax_prop", sample_prop = obj$data$tax_prop[[sample]]) %>%
    filter_taxa(to_use) 

It would be nice to figure out what is happening here, but either way, having a filter_taxa_ that does not use NSE would be useful.

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

1 participant