ropensci / taxa

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

`filter_taxa` throws error when `funcs` is empty #41

Closed zachary-foster closed 7 years ago

zachary-foster commented 7 years ago
> my_taxmap <- taxmap(tiger, cat, mole, human, tomato, potato,
+                     data = list(info = info,
+                                 phylopic_ids = phylopic_ids,
+                                 foods = foods))
> my_taxmap
<Taxmap>
  17 taxa: 1. Mammalia, 2. Plantae, 3. Felidae ... 14. typhlops, 15. sapiens, 16. lycopersicum, 17. tuberosum
  17 edges: NA->1, NA->2, 1->3, 1->4, 1->5, 2->6, 3->7 ... 5->10, 6->11, 7->12, 8->13, 9->14, 10->15, 11->16, 11->17
  3 data sets:
    info:

    phylopic_ids:  e148eabb-f138-43c6-b1e4-5cda2180485a ... 63604565-0406-460b-8cb8-1abe954b3f3a
    foods: a list with 6 items
  0 functions:
> filter_taxa(my_taxmap, startsWith(name, "t"))
 Show Traceback

 Rerun with Debug
 Error in names(func_names) <- rep("funcs", length(func_names)) : 
  attempt to set an attribute on NULL 
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.1 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] taxa_0.0.4.9105

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.10     digest_0.6.12    dplyr_0.5.0      rprojroot_1.2    assertthat_0.2.0 R6_2.2.0         jsonlite_1.4    
 [8] DBI_0.6-1        backports_1.0.5  magrittr_1.5     evaluate_0.10    stringi_1.1.5    lazyeval_0.2.0   rmarkdown_1.4   
[15] tools_3.3.1      stringr_1.2.0    yaml_2.1.14      htmltools_0.3.5  knitr_1.15.1     tibble_1.3.0