ropensci / RNeXML

Implementing semantically rich NeXML I/O in R
https://docs.ropensci.org/RNeXML
Other
13 stars 9 forks source link

get_characters() fails, possibly due to dplyr bug? #147

Closed hlapp closed 8 years ago

hlapp commented 8 years ago

Here is the stack traceback:

> study_matrix <- pk_get_study(nex_list)
Map symbols to labels...
 Error: 'matches' is not an exported object from 'namespace:dplyr' 
21 stop(gettextf("'%s' is not an exported object from 'namespace:%s'", 
    name, getNamespaceName(ns)), call. = FALSE, domain = NA) 
20 getExportedValue(pkg, name) 
19 dplyr::matches 
18 eval(expr, envir, enclos) 
17 eval(x$expr, data, x$env) 
16 FUN(X[[i]], ...) 
15 lapply(x, lazy_eval, data = data) 
14 lazyeval::lazy_eval(args, c(names_list, select_funs)) 
13 select_vars_(names(.data), dots) 
12 select_.data.frame(., drop) 
11 dplyr::select_(., drop) 
10 function_list[[i]](value) 
9 freduce(value, `_function_list`) 
8 `_fseq`(`_lhs`) 
7 eval(expr, envir, enclos) 
6 eval(quote(`_fseq`(`_lhs`)), env, env) 
5 withVisible(eval(quote(`_fseq`(`_lhs`)), env, env)) 
4 get_level(nex, "otus/otu") %>% dplyr::select_(drop) %>% optional_labels(id_col = "otu") 
3 get_characters(nex, rownames_as_col = TRUE, otu_id = TRUE) at pk_study.R#109
2 pk_get_study_by_one(n) at pk_study.R#73
1 pk_get_study(nex_list) 
> 

BTW I get this error too from the rphenoscape vignette. (It's past the first error now after fixing the XML parsing.)

Is something awry with dplyr or is there another issue?

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.5 (El Capitan)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] dplyr_0.4.3     xml2_0.1.2      XML_3.98-1.4    httr_1.2.0      rphenoscape_0.1
[6] RNeXML_2.0.6    ape_3.5        

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.5      magrittr_1.5     uuid_0.1-2       rotl_3.0.0       lattice_0.20-33 
 [6] R6_2.1.2         foreach_1.4.3    stringr_1.0.0    rentrez_1.0.2    plyr_1.8.4      
[11] tools_3.2.3      parallel_3.2.3   rredlist_0.1.0   bold_0.3.5       grid_3.2.3      
[16] data.table_1.9.6 nlme_3.1-128     DBI_0.4-1        iterators_1.0.8  lazyeval_0.2.0  
[21] assertthat_0.1   tibble_1.0       taxize_0.7.8     tidyr_0.5.1      reshape2_1.4.1  
[26] codetools_0.2-14 curl_0.9.7       stringi_1.1.1    rncl_0.6.0       jsonlite_0.9.22 
[31] reshape_0.8.5    chron_2.3-47    
> 
cboettig commented 8 years ago

@hlapp sorry, this is also due to the current dplyr version. matches was introduced in the new dplyr, whose release is 3 days out I'm told. Unfortunately in patching RNeXML for the upcoming dplyr meant being incompatible with the current dplyr. As in previous issues, this one should go away if you install using:

devtools::install_github("ropensci/RNeXML")

which will get the pre-release dplyr (0.4.3.9001) from our additionalRepositories listed instead of the CRAN version (0.4.3) you have here.

Guess this is the challenge with having fast-evolving dependencies that break things. (We patched things for the tidyr change and the dpyr change at the same time; unfortunately tidyr is already on CRAN while dplyr is still pending.

Anyway all these issues should go away once dplyr hits CRAN (and users upgrade to the latest versions of all dependencies).

sckott commented 8 years ago

did the dev version of RNeXML work @hlapp ?

hlapp commented 8 years ago

@cboettig looks like the automatic way you describe doesn't work:

Warning: unable to access index for repository http://packages.ropensci.org/bin/macosx/mavericks/contrib/3.3:
  cannot download all files

  There are binary versions available (and will be installed) but the source
  versions are later:
           binary     source
dplyr       0.4.3 0.4.3.9001
rotl        3.0.0  3.0.0.901
rredlist    0.1.0 0.1.0.9000
taxize      0.7.8 0.7.8.9000
XML      3.98-1.4     3.99-0
xml2        0.1.2 0.1.2.9000

I'll reinstall dplyr from Github by hand. I hope the binary CRAN versions of the other packages are OK?

hlapp commented 8 years ago

Looks like installing dplyr from Github doesn't work either:

> install_github("hadley/dplyr")
Downloading GitHub repo hadley/dplyr@master
from URL https://api.github.com/repos/hadley/dplyr/zipball/master
Installing dplyr
Downloading GitHub repo hadley/dtplyr@master
from URL https://api.github.com/repos/hadley/dtplyr/zipball/master
Installing dtplyr
Downloading GitHub repo hadley/dplyr@master
from URL https://api.github.com/repos/hadley/dplyr/zipball/master
Installing dplyr
Downloading GitHub repo hadley/dtplyr@master
from URL https://api.github.com/repos/hadley/dtplyr/zipball/master
Installing dtplyr

And that then keeps cycling over those two steps forever, never finishes.

Should I be using a different branch perhaps?

cboettig commented 8 years ago

@hlapp apparently you need the github version of devtools to install the github version of dplyr.

Sorry the way i suggested didn't work, I hadn't tested on a Mac. Try adding type="source" to the call -- for some reason it is not detecting that Mac binaries for dplyr are not available but source is.

hlapp commented 8 years ago

Fortunately, the dplyr update has now been released on CRAN, and installing it fixes this issue.