PoisotLab / paco

Procrustes analysis of cophylogenies
Other
2 stars 6 forks source link

Error in missing(type) : 'missing' can only be used for arguments #13

Closed tpoisot closed 8 years ago

tpoisot commented 9 years ago

Any idea why this is happening?

Below I am copying the R session:

library(paco) library(ape) data(gopherlice) gdist <- cophenetic(gophertree) ldist <- cophenetic(licetree) D <- prepare_paco_data(gdist, ldist, gl_links) D <- add_pcoord(D) D <- PACo(D, nperm=1000, seed=42, method="r0") There were 50 or more warnings (use warnings() to see the first 50) print(D$gof) $p [1] 0

$ss [1] 0.07310926

$n [1] 1000

up to this point everything worked fine, but now:

paco_links(D, .parallel = FALSE) Error in missing(type) : 'missing' can only be used for arguments In addition: Warning message: In vegan::procrustes(X = PACo.ind$H_PCo, Y = PACo.ind$P_PCo) : X has fewer axes than Y: X adjusted to comform Y

if .parallel =TRUE:

paco_links(D, .parallel = TRUE) Error in do.ply(i) : task 1 failed - "'missing' can only be used for arguments" In addition: There were 18 warnings (use warnings() to see them)

similar error with residuals:

residuals(D, matrix) Error in missing(type) : 'missing' can only be used for arguments

tpoisot commented 9 years ago

By the way @matthutchinson1 and @efcaguab -- both of you now can write / push to this repo. What this means is, PLEASE use a branch other than master to do the big fixing.

matthutchinson1 commented 9 years ago

I think the main issue is this line:

plyr::adply(1:nlinks, 1, function(x) single_paco_link(D, HP.ones, x), .parallel=.parallel)

I'm not super familiar with the code, Fer, can you have a look please?

efcaguab commented 9 years ago

I'll have a look when I go back to chc. For now on I have the feeling the issue can be resolved by including require(plyr) at the beginning of the function (or otherwise loading the package before calling pack links.

tpoisot commented 9 years ago

What about plyr::whatever() ?