Running 'misctests.R' [3s]
  Running 'phylo4dtests.R' [175s]
  Running 'phylosubtest.R' [2s]
  Running 'phylotorture.R' [3s]
  Running 'plottest.R' [152s]
  Running 'roundtrip.R' [167s]
  Running 'test-all.R' [168s]
  Running 'testprune.R' [173s]
Running the tests in 'tests/phylo4dtests.R' failed.
Complete output:
  > library(phylobase)
  > library(ape)
  
  Attaching package: 'ape'
  
  The following object is masked from 'package:phylobase':
  
      edges
  
  > tree.phylo <- read.tree(text="(((A,B)C,D),E);")  #only one node is labelled
  > tree <- as(tree.phylo, "phylo4")
  > 
  > tree.phylo2 <- read.tree(text="(((A,B)C,D)F,E)G;")  # all nodes labelled
  > tree2 <- as(tree.phylo2, "phylo4")
  > 
  > tip.data <- data.frame(size=c(1, 2, 3, 4))
  > rownames(tip.data) <- c("A", "B", "E", "D")
  > 
  > treed <- phylo4d(tree, tip.data)
  > dat2 <- data.frame(size=c(0,1,2), row.names=c("G", "F", "C"))
  > 
  > try(phylo4d(tree, node.data=dat2), silent = TRUE)  # error, cannot match data because no node labels on tree
  > phylo4d(tree2, node.data=dat2) -> treed2  # OK tree labelled; has node data, no tip data 
  > 
  > plot(treed2) # works with a warning about no tip data to plot
  Warning message:
  In treePlot(x, ...) : tree has no tip data to plot
  > tipData(treed2, empty.columns=FALSE) #returns empty 4-row data.frame
  data frame with 0 columns and 4 rows
  > 
  > phylo4d(tree2, tip.data=tip.data, node.data=dat2) -> treed3 #node+tip data
  > 
  > plot(treed3)  # works
  > tipData(treed3)  #works, but returns tips only
    size
  A    1
  B    2
  D    4
  E    3
  > tdata(treed3, "all")
    size
  A    1
  B    2
  D    4
  E    3
  G    0
  F    1
  C    2
  > 
  > print(tree)
    label node ancestor edge.length node.type
  1     A    1        7          NA       tip
  2     B    2        7          NA       tip
  3     D    3        6          NA       tip
  4     E    4        5          NA       tip
  5  <NA>    5        0          NA      root
  6  <NA>    6        5          NA  internal
  7     C    7        6          NA  internal
  > print(treed)
    label node ancestor edge.length node.type size
  1     A    1        7          NA       tip    1
  2     B    2        7          NA       tip    2
  3     D    3        6          NA       tip    4
  4     E    4        5          NA       tip    3
  5  <NA>    5        0          NA      root   NA
  6  <NA>    6        5          NA  internal   NA
  7     C    7        6          NA  internal   NA
  > 
  > 
  > proc.time()
     user  system elapsed 
     1.92    0.28    2.21 
Running the tests in 'tests/plottest.R' failed.
Complete output:
  > library(phylobase)
  > library(ape)
  
  Attaching package: 'ape'
  
  The following object is masked from 'package:phylobase':
  
      edges
  
  > 
  > data(geospiza)
  > g1 <- as(geospiza,"phylo4")
  > g2 <- geospiza
  > 
  > par(mfrow=c(1,2))
  > plot(g1, show.node.label=TRUE)
  > ## be careful with this: works if par("fin")=c(5.56,6.77)
  > ##                       fails if par("fin")=c(4.87,6.77)
  > ##try(plot(g2,show.node.label=TRUE),silent=TRUE)
  > ## Here, R was complaining about a lack of room to plot data
  > ## so nothing abnormal. -- TJ
  > plot(g2, show.node.label=TRUE)
  > 
  > 
  > ## commented out since phylog objects are deprecated anyway
  > ## g2B <- as(extractTree(g2), "phylog")
  > ##  Note the numbering differences!
  > 
  > ## round trip
  > g2C <- as(read.tree(text=write.tree(as(g1, "phylo"))), "phylo4")
  Warning message:
  In asMethod(object) : trees with unknown order may be unsafe in ape
  > ## comes back in same order
  > try(plot(g1, show.node.label=TRUE))
  > try(plot(g2C, show.node.label=TRUE))
  > 
  > g3 = subset(g2, tips.exclude=c("fuliginosa", "fortis", "magnirostris",
  +                  "conirostris", "scandens"))
  > plot(extractTree(g3))  ## phylo4
  > plot(g3)
  > 
  > 
  > ## Playing with new ways of plotting
  > 
  > if (FALSE) {
  + if(require(MASS)){
  +     dist1 <- cophenetic.phylo(as(g2, "phylo"))
  +     mdspos <- isoMDS(dist1)$points
  +     par(mfrow=c(2, 2))
  +     plot(g1)
  +     ## plot(mdspos,type="n")
  +     ## text(mdspos[,1],mdspos[,2],abbreviate(rownames(mdspos)))
  +     ## cmdpos <- cmdscale(dist1)
  +     ## plot(cmdpos,type="n")
  +     ## text(cmdpos[,1],cmdpos[,2],abbreviate(rownames(mdspos)))
  + }
  + ## never mind, I don't know how to construct a useful
  + ##  2D color space anyway ...
  + }
  > 
  > treePlot(g2,plot.at.tip=TRUE,tip.plot.fun=
  +          function(x,...) {
  +            grid::grid.points(seq(along=x),x)})
  > 
  > proc.time()
     user  system elapsed 
     1.96    0.28    2.32 
Running the tests in 'tests/roundtrip.R' failed.
Complete output:
  > library(phylobase)
  > library(ape)
  
  Attaching package: 'ape'
  
  The following object is masked from 'package:phylobase':
  
      edges
  
  > 
  > ## set.seed(1)
  > ## t0A <- rcoal(5)
  > t0 <- read.tree(text="((t4:0.3210275554,(t2:0.2724586465,t3:0.2724586465):0.0485689089):0.1397952619,(t5:0.07551818331,t1:0.07551818331):0.385304634);")
  > ## hack around variability in ape:
  > ##   read.tree() and rcoal() produce sets of
  > ##     elements in different orders
  > t0 <- unclass(t0)[c("edge","edge.length","tip.label","Nnode")]
  > class(t0) <- "phylo"
  > 
  > ## phylo -> phylo4 -> phylo
  > t1 <- as(t0,"phylo4")
  > t5 <- as(t1,"phylo")
  Warning message:
  In asMethod(object) : trees with unknown order may be unsafe in ape
  > stopifnot(identical(t0,t5))
  > 
  > ## phylo4 -> phylo4vcov -> phylo4 -> phylo
  > t2<-as(t1,"phylo4vcov")
  Warning message:
  In asMethod(object) : trees with unknown order may be unsafe in ape
  > t3<-as(t2,"phylo4")
  > t4<-as(t3,"phylo")
  > stopifnot(identical(t4$edge,t0$edge) &&
  +           identical(t4$tip.label,t0$tip.label) &&
  +           identical(t4$Nnode,t0$Nnode) &&
  +           max(abs(t4$edge.length-t0$edge.length))<1e-10)
  > 
  > ## UNROOTED
  > t6 <- ape::unroot(t0)
  > ## hack around ape conversion issues:
  > ##  unroot() converts integer to double
  > storage.mode(t6$edge) <- "integer"
  > storage.mode(t6$Nnode) <- "integer"
  > t7 <- as(as(t6,"phylo4"),"phylo")
  > stopifnot(identical(t6,t7))
  > 
  > 
  > ## EXPLICIT ROOT EDGE
  > t8 <- t0
  > t8$root.edge <- 0.5
  > t9 <- as(as(t8,"phylo4"),"phylo")
  Warning message:
  In asMethod(object) : trees with unknown order may be unsafe in ape
  > stopifnot(identical(t8,t9))
  > 
  > proc.time()
     user  system elapsed 
     1.90    0.29    2.14 
Running the tests in 'tests/test-all.R' failed.
Complete output:
  > ## This script is only run during R CMD check, so we can set an environment
  > ## variable that will only run tests during R CMD check (or `devtools::check()`)
  > ## and not during `devtools::test()`.
  > 
  > ## Thus in the tests, we can request the NEXUS files that are stored in the
  > ## `inst/` folder, but during the checks, we test the files that have been
  > ## installed (using the `system.file()` function).
  > 
  > library(testthat)
  > 
  > Sys.setenv("R_CMD_CHECK" = "true")
  > 
  > test_check("phylobase")
  Loading required package: phylobase
  [ FAIL 0 | WARN 2 | SKIP 0 | PASS 639 ]
  
  [ FAIL 0 | WARN 2 | SKIP 0 | PASS 639 ]
  > 
  > proc.time()
     user  system elapsed 
    10.31    0.78   11.11 
Running the tests in 'tests/testprune.R' failed.
Complete output:
  > library(phylobase)
  > library(ape)
  
  Attaching package: 'ape'
  
  The following object is masked from 'package:phylobase':
  
      edges
  
  > 
  > set.seed(1)
  > r1 <- rcoal(5)
  > 
  > ## trace("phylo4d", browser, signature = "phylo")
  > ## untrace("phylo4d", signature = "phylo")
  > tipdat <- data.frame(a=1:5,row.names=r1$tip.label)
  > p1 <- phylo4d(r1,tip.data=tipdat,node.data=data.frame(a=6:9), match.data=FALSE)
  > p2 <- prune(p1,1)
  > summary(p2)
  
   Phylogenetic tree : as(x, "phylo4") 
  
   Number of tips    : 4 
   Number of nodes   : 3 
   Branch lengths:
          mean         : 0.252522 
          variance     : 0.02063627 
          distribution :
     Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  0.04857 0.17296 0.27246 0.25252 0.30889 0.46082 
  
  Comparative data:
  
  Tips: data.frame with 4 taxa and 1 variable(s) 
  
         a       
   Min.   :2.00  
   1st Qu.:2.75  
   Median :3.50  
   Mean   :3.50  
   3rd Qu.:4.25  
   Max.   :5.00  
  
  Nodes: data.frame with 3 internal nodes and 1 variables 
  
         a      
   Min.   :6.0  
   1st Qu.:6.5  
   Median :7.0  
   Mean   :7.0  
   3rd Qu.:7.5  
   Max.   :8.0  
  > 
  > ## from picante
  > `phylo2phylog` <-
  + function(phy, ...) {
  +     newick2phylog(write.tree(phy, multi.line = FALSE),...)
  + }
  > 
  > plot.phylo(as(p2,"phylo"))
  Warning message:
  In asMethod(object) : losing data while coercing phylo4d to phylo
  > 
  > proc.time()
     user  system elapsed 
     2.03    0.43    2.40