ropensci / phylocomr

Phylocom R interface
https://docs.ropensci.org/phylocomr
Other
15 stars 7 forks source link

issue with ph_aot with phylo files: #26

Closed Jez-R closed 5 years ago

Jez-R commented 5 years ago
Session Info version R version 3.6.0 (2019-04-26) os macOS 10.15.1 system x86_64, darwin15.6.0 ui RStudio language (EN) collate en_AU.UTF-8 ctype en_AU.UTF-8 date 2019-11-19

I'm having an issue with ph_aot trying to import phylogenies from phylo files:

Error in seq.default(from = grep("Trait conservatism by node", out) + : 'from' must be of length 1

The example from the vignette - readLines(phylo_file) - works fine, but I can't figure out the issue importing phylo objects. Apologies in advance if this is something basic.

Example code below:

library(ape)
data(bird.orders)
tree <- (bird.orders)

traits <- data.frame("name" = 1:23)

traits$name <- tree$tip.label
traits$traitA <- rbinom(23, 1,.5)
traits$traitB <- rbinom(23, 1,.5)
traits$traitC <- rbinom(23, 1,.5)
traits$traitD <- as.integer(floor(runif(23, 1,5)))

tree$tip.label %in% traits$name
tree2 <- write.tree(tree)

ph_aot(traits = traits, phylo = tree)
ph_aot(traits = traits, phylo = tree2)
sckott commented 5 years ago

thanks for the report - for session info what we mean is, load the package in question first, then run session info, so we know what versions of packages you have installed. What version of phylocomr do you have?

Jez-R commented 5 years ago

Sorry about that (long time listener, first time caller). Hope this is correct.


R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS  10.15.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

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

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

other attached packages:
[1] phylocomr_0.2.0
sckott commented 5 years ago

working on a solutino

Jez-R commented 5 years ago

Many thanks! Also with the above code, it should be:

data(bird.orders) tree <- (bird.orders)

sckott commented 5 years ago

right, i figured that out 😉

sckott commented 5 years ago

@Jez-R reinstall remotes::install_github("ropensci/phylocomr") and try again