Re: [R-sig-phylo] A test for valid phylo object (ape package) for package developers

2019-11-05 Thread Elizabeth Purdom
Thank you very much, I’ll try that!

> On Nov 5, 2019, at 2:20 PM, Liam Revell  wrote:
> 
> Hi Elizabeth.
> 
> This does not do exactly what you want, but it is possible to use 
> capture.output() to grab the printout of checkValidPhylo() and then 
> grep() to see if it contains instances of "MODERATE" or "FATAL" errors.
> 
> The following simple function does that. It returns 0 if neither 
> MODERATE nor FATAL errors are detected in the "phylo" object, 1 if at 
> least one MODERATE error (but no FATAL errors) is detected, and 2 if any 
> FATAL errors are detected:
> 
> chk.phylo<-function(x){
>   object<-capture.output(checkValidPhylo(x))
>   if(length(grep("FATAL",object))>0) return(2)
>   else if(length(grep("MODERATE",object))>0) return(1)
>   else return(0)
> }
> 
> E.g.:
> 
> library(ape)
> 
> t1<-rtree(n=10)
> 
> chk.phylo(t1) ## should return 0
> 
> t2<-t1
> t2$Nnode<-9.5
> 
> chk.phylo(t2) ## should return 1
> 
> t3<-t1
> t3$edge<-t3$edge[-4,]
> 
> chk.phylo(t3) ## should return 2
> 
> All the best, Liam
> 
> Liam J. Revell
> Associate Professor, University of Massachusetts Boston
> Profesor Asistente, Universidad Católica de la Ssma Concepción
> web: http://faculty.umb.edu/liam.revell/, http://www.phytools.org
> 
> Academic Director UMass Boston Chile Abroad (starting 2019):
> https://www.umb.edu/academics/caps/international/biology_chile
> 
> On 11/5/2019 5:54 PM, Elizabeth Purdom wrote:
>> [EXTERNAL SENDER]
>> 
>> Hello,
>> 
>> I am working with the phylo object from the ape package in my own package in 
>> which I am manipulating the trees. I would like to check that I have 
>> successfully created a valid ape object, but the `checkValidPhylo` function 
>> appears to be solely interactive — it prints out a display, and always 
>> returns NULL.
>> 
>> Is there a function in the ape package (or can there be?) that would do the 
>> checks, but return the results in a way that I can then process in my 
>> function? (e.g. return a vector of each of the checks as TRUE/FALSE) And I 
>> don’t want anything printed out, since I don’t want that output to be 
>> printed for users of my function).
>> 
>> I see the package `paleotree` has ported some of those checks into a test, 
>> so I’m guessing such a function doesn’t exist in ape — and I don’t really 
>> want a dependency on another package just for these checks.
>> 
>> Thanks,
>> Elizabeth Purdom
>> ___
>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
>> https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-phylodata=02%7C01%7Cliam.revell%40umb.edu%7C6584f4bb63dd48f9205008d762326164%7Cb97188711ee94425953c1ace1373eb38%7C0%7C1%7C637085840853226654sdata=48LVGO%2FHHvX0rpMy6FaVgIhoeV6UO8Ouc%2B6FUfJcFCM%3Dreserved=0
>> Searchable archive at 
>> https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.mail-archive.com%2Fr-sig-phylo%40r-project.org%2Fdata=02%7C01%7Cliam.revell%40umb.edu%7C6584f4bb63dd48f9205008d762326164%7Cb97188711ee94425953c1ace1373eb38%7C0%7C1%7C637085840853226654sdata=qgug0JIrKlC9fpr8lqrMuBku2XpHV3hfbzPF0m8ByuI%3Dreserved=0
>> 

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


[R-sig-phylo] A test for valid phylo object (ape package) for package developers

2019-11-05 Thread Elizabeth Purdom
Hello,

I am working with the phylo object from the ape package in my own package in 
which I am manipulating the trees. I would like to check that I have 
successfully created a valid ape object, but the `checkValidPhylo` function 
appears to be solely interactive — it prints out a display, and always returns 
NULL. 

Is there a function in the ape package (or can there be?) that would do the 
checks, but return the results in a way that I can then process in my function? 
(e.g. return a vector of each of the checks as TRUE/FALSE) And I don’t want 
anything printed out, since I don’t want that output to be printed for users of 
my function). 

I see the package `paleotree` has ported some of those checks into a test, so 
I’m guessing such a function doesn’t exist in ape — and I don’t really want a 
dependency on another package just for these checks. 

Thanks,
Elizabeth Purdom
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] installing a testing version of ape

2017-10-17 Thread Elizabeth Purdom
Sorry, I had to restart R and then it worked. All of the best, Elizabeth


> On Oct 17, 2017, at 4:06 PM, Emmanuel Paradis <emmanuel.para...@ird.fr> wrote:
> 
> Maybe your network has a cache or a firewall (or something similar blocking 
> you). I just tried from here and it worked:
> 
> R> download.packages("ape", ".", repos = "http://ape-package.ird.fr/;)
> trying URL 'http://ape-package.ird.fr/src/contrib/ape_4.9.tar.gz'
> Content type 'application/x-gzip' length 755146 bytes (737 KB)
> ==
> downloaded 737 KB
> 
> [,1]  [,2]
> [1,] "ape" "./ape_4.9.tar.gz"
> 
> The Win build is also available. The NEWS file is here:
> 
> http://ape-package.ird.fr/NEWS
> 
> Best,
> 
> Emmanuel
> 
> Le 17/10/2017 à 15:52, Elizabeth Purdom a écrit :
>> Thanks Emmanuel!
>> I do not yet see it yet (I still get the same response in R when following 
>> those commands). I also don’t see anything in NEWS on the front page since 
>> 2017-05-03 so maybe I’m having a bigger problem, but I will check again 
>> later today to see if it changes.
>> All of the best,
>> Elizabeth
>>> On Oct 17, 2017, at 2:47 PM, Emmanuel Paradis <emmanuel.para...@ird.fr> 
>>> wrote:
>>> 
>>> Hi Elizabeth,
>>> 
>>> I have submitted ape 5.0 on CRAN on 5 October but I'm still waiting for 
>>> feedback. I suspect there are problems with reverse dependencies. In the 
>>> meantime, I cleared the testing repositories thinking that CRAN would take 
>>> the usual 1-2 days to publish the new version. Sorry for the confusion.
>>> 
>>> I have just uploaded a version 4.9 on the testing repos which is virtually 
>>> identical to the version being examined by CRAN. I'll upload a Windows 
>>> build in a few hours. The NEWS file on ape-package.ird.fr has been updated.
>>> 
>>> Best,
>>> 
>>> Emmanuel
>>> 
>>> Le 17/10/2017 à 12:11, Elizabeth Purdom a écrit :
>>>> Hello,
>>>> I currently have version 4.1 of ape installed on my computer (Mac OS X, R 
>>>> 3.4.2) which appears to currently be the most up-to-date on CRAN. However, 
>>>> I am trying to get the testing version of ape, because I know that there 
>>>> have been changes made that I would like to take advantage of without 
>>>> waiting for them to show up on CRAN. I have tried using the commands on 
>>>> the website, and they do not show any new versions available. 
>>>> Specifically, using `old.packages`, nothing is returned:
>>>>> old.packages(repos = "http://ape-package.ird.fr/;)
>>>> NULL
>>>> And trying to download anyway gets me an error:
>>>>> download.packages("ape", ".", repos = "http://ape-package.ird.fr/;)
>>>> trying URL 'http://ape-package.ird.fr/src/contrib/ape_0.0.1.tar.gz'
>>>> Error in download.file(url, destfile, method, mode = "wb", ...) :
>>>>   cannot open URL 'http://ape-package.ird.fr/src/contrib/ape_0.0.1.tar.gz'
>>>> In addition: Warning message:
>>>> In download.file(url, destfile, method, mode = "wb", ...) :
>>>>   cannot open URL 
>>>> 'http://ape-package.ird.fr/src/contrib/ape_0.0.1.tar.gz': HTTP status was 
>>>> '404 Not Found'
>>>> Warning in download.packages("ape", ".", repos = 
>>>> "http://ape-package.ird.fr/;) :
>>>>   download of package ‘ape’ failed
>>>>  [,1] [,2]
>>>> This is presumably because http://ape-package.ird.fr/src/contrib/PACKAGES 
>>>> points to 0.0.1. I don’t immediately see an option to specify a version of 
>>>> the package (and indeed I don’t know what version I would put in). Do I 
>>>> need to be running a development version of R to get the newest versions 
>>>> of ape?
>>>> Thanks for any help,
>>>> Elizabeth Purdom
>>>> PS Here is my sessionInfo:
>>>>> sessionInfo()
>>>> R version 3.4.2 (2017-09-28)
>>>> Platform: x86_64-apple-darwin15.6.0 (64-bit)
>>>> Running under: OS X El Capitan 10.11.6
>>>> Matrix products: default
>>>> BLAS: 
>>>> /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
>>>> LAPACK: 
>>>> /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
>>>> 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] BiocInstaller_1.26.1
>>>> loaded via a namespace (and not attached):
>>>> [1] compiler_3.4.2 tools_3.4.2
>>>> ___
>>>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>>>> Searchable archive at 
>>>> http://www.mail-archive.com/r-sig-phylo@r-project.org/

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] installing a testing version of ape

2017-10-17 Thread Elizabeth Purdom
Thanks Emmanuel! 

I do not yet see it yet (I still get the same response in R when following 
those commands). I also don’t see anything in NEWS on the front page since 
2017-05-03 so maybe I’m having a bigger problem, but I will check again later 
today to see if it changes.

All of the best,
Elizabeth


> On Oct 17, 2017, at 2:47 PM, Emmanuel Paradis <emmanuel.para...@ird.fr> wrote:
> 
> Hi Elizabeth,
> 
> I have submitted ape 5.0 on CRAN on 5 October but I'm still waiting for 
> feedback. I suspect there are problems with reverse dependencies. In the 
> meantime, I cleared the testing repositories thinking that CRAN would take 
> the usual 1-2 days to publish the new version. Sorry for the confusion.
> 
> I have just uploaded a version 4.9 on the testing repos which is virtually 
> identical to the version being examined by CRAN. I'll upload a Windows build 
> in a few hours. The NEWS file on ape-package.ird.fr has been updated.
> 
> Best,
> 
> Emmanuel
> 
> Le 17/10/2017 à 12:11, Elizabeth Purdom a écrit :
>> Hello,
>> I currently have version 4.1 of ape installed on my computer (Mac OS X, R 
>> 3.4.2) which appears to currently be the most up-to-date on CRAN. However, I 
>> am trying to get the testing version of ape, because I know that there have 
>> been changes made that I would like to take advantage of without waiting for 
>> them to show up on CRAN. I have tried using the commands on the website, and 
>> they do not show any new versions available. Specifically, using 
>> `old.packages`, nothing is returned:
>>> old.packages(repos = "http://ape-package.ird.fr/;)
>> NULL
>> And trying to download anyway gets me an error:
>>> download.packages("ape", ".", repos = "http://ape-package.ird.fr/;)
>> trying URL 'http://ape-package.ird.fr/src/contrib/ape_0.0.1.tar.gz'
>> Error in download.file(url, destfile, method, mode = "wb", ...) :
>>   cannot open URL 'http://ape-package.ird.fr/src/contrib/ape_0.0.1.tar.gz'
>> In addition: Warning message:
>> In download.file(url, destfile, method, mode = "wb", ...) :
>>   cannot open URL 'http://ape-package.ird.fr/src/contrib/ape_0.0.1.tar.gz': 
>> HTTP status was '404 Not Found'
>> Warning in download.packages("ape", ".", repos = 
>> "http://ape-package.ird.fr/;) :
>>   download of package ‘ape’ failed
>>  [,1] [,2]
>> This is presumably because http://ape-package.ird.fr/src/contrib/PACKAGES 
>> points to 0.0.1. I don’t immediately see an option to specify a version of 
>> the package (and indeed I don’t know what version I would put in). Do I need 
>> to be running a development version of R to get the newest versions of ape?
>> Thanks for any help,
>> Elizabeth Purdom
>> PS Here is my sessionInfo:
>>> sessionInfo()
>> R version 3.4.2 (2017-09-28)
>> Platform: x86_64-apple-darwin15.6.0 (64-bit)
>> Running under: OS X El Capitan 10.11.6
>> Matrix products: default
>> BLAS: 
>> /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
>> LAPACK: 
>> /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
>> 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] BiocInstaller_1.26.1
>> loaded via a namespace (and not attached):
>> [1] compiler_3.4.2 tools_3.4.2
>> ___
>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] installing a testing version of ape

2017-10-17 Thread Elizabeth Purdom
Hello,

I currently have version 4.1 of ape installed on my computer (Mac OS X, R 
3.4.2) which appears to currently be the most up-to-date on CRAN. However, I am 
trying to get the testing version of ape, because I know that there have been 
changes made that I would like to take advantage of without waiting for them to 
show up on CRAN. I have tried using the commands on the website, and they do 
not show any new versions available. Specifically, using `old.packages`, 
nothing is returned:

> old.packages(repos = "http://ape-package.ird.fr/;)
NULL

And trying to download anyway gets me an error:

> download.packages("ape", ".", repos = "http://ape-package.ird.fr/;)
trying URL 'http://ape-package.ird.fr/src/contrib/ape_0.0.1.tar.gz'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'http://ape-package.ird.fr/src/contrib/ape_0.0.1.tar.gz'
In addition: Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
  cannot open URL 'http://ape-package.ird.fr/src/contrib/ape_0.0.1.tar.gz': 
HTTP status was '404 Not Found'
Warning in download.packages("ape", ".", repos = "http://ape-package.ird.fr/;) :
  download of package ‘ape’ failed
 [,1] [,2]

This is presumably because http://ape-package.ird.fr/src/contrib/PACKAGES 
points to 0.0.1. I don’t immediately see an option to specify a version of the 
package (and indeed I don’t know what version I would put in). Do I need to be 
running a development version of R to get the newest versions of ape? 

Thanks for any help,
Elizabeth Purdom

PS Here is my sessionInfo:

> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6

Matrix products: default
BLAS: 
/Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: 
/Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

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] BiocInstaller_1.26.1

loaded via a namespace (and not attached):
[1] compiler_3.4.2 tools_3.4.2   

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] Can I get coordinates from plot.phylo and not get blank page

2017-09-26 Thread Elizabeth Purdom
Hello,

I am writing a function that calls plot.phylo in the ape package with the 
option plot=FALSE. I then do some calculations with the output (the calculated 
coordinates), and then make another call to plot.phylo with plot=TRUE. If I do 
this, then the plot=FALSE option creates a blank plot, which is the result that 
is clearly documented in the help pages. 

However, I do not want this blank plot, because I am saving the result (the 
second call to plot.phylo) to a pdf, and so the pdf has a blank page before the 
plot I want. And since I’m calling this in a function, I can’t “wait” for the 
second plot (a similar problem occurs if you run it in a knitr document)

Is there a way to get the output from plot.phylo with all of the coordinates, 
etc. without having to have the blank plot? (I do not want an option to “add” 
the plot to the blank plot, if it exists, because I am doing these calculations 
so that in my next call I can change the x.lim options so the tree only takes 
up a fraction of the plot, so I need to reset the par, etc., and not just draw 
on the original coordinates set up by the blank plot)

Thank you,
Elizabeth Purdom
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] ape package: improvement suggestion in color handling for mosaic in phydataplot?

2017-05-23 Thread Elizabeth Purdom
Dear all,

I am trying to use the phydataplot function in the ape package with the style 
mosaic. I am having difficulty getting the colors of the rectangles to be the 
color I desire in an automatic way. I have come to the conclusion that I can’t 
do and it would have to be an enhancement to the package, though I would be 
glad to know I am wrong. 

Here is the example in phydataplot for how to set the colors

set.seed(1378923)
## use type = "mosaic" on a 30x5 matrix:
tr <- rtree(n <- 30)
p <- 5
x <- matrix(sample(3, size = n*p, replace = TRUE), n, p)
dimnames(x) <- list(paste0("t", 1:n), LETTERS[1:p])
plot(tr, x.lim = 35, align.tip = TRUE, adj = 1)
phydataplot(x, tr, "m", 2, width = 2, border = "white", lwd = 3, legend = 
"side")
f <- function(n) c("yellow", "blue", "red")
phydataplot(x, tr, "m", 18, width = 2, border = "white", lwd = 3,
legend = "side", funcol = f)

Notice we set the colors with the function  c("yellow", "blue", "red”). 
However, we see when we plot them, that this assignment resulted in 2=yellow, 
3=blue, 1=red. If instead I want 1=yellow, 2=blue, 3=red, I can use this plot I 
just made to see how they should be ordered to get my desired color assignment, 
and rearrange the colors: 

plot(tr, x.lim = 35, align.tip = TRUE, adj = 1)
phydataplot(x, tr, "m", 2, width = 2, border = "white", lwd = 3, legend = 
"side")
f <- function(n) c("blue", "red", "yellow")
phydataplot(x, tr, "m", 18, width = 2, border = "white", lwd = 3,
legend = "side", funcol = f)

However, I see no way to do this without first plotting them, manually looking 
at the arbitrary order created, and then fixing it. Yet, I would like to do 
this in an automatic fashion — I’m trying to build a function on top of this 
function — so I need to know ahead of time how phydataplot will assign the 
colors (and so if my tree changes it will still give the desired colors). 
Looking at the internal function, the relevant stream of code is the following 
(i.e. cutting away the parts not needed for determining the colors) and shows 
that the assignment of colors to data is entirely dependent on the order of the 
data after the function internally matches it to the tree:

lastPP <- get("last_plot.phylo", envir = .PlotPhyloEnv)
x <- .matchDataPhylo(x, phy)
n <- length(phy$tip.label)
one2n <- seq_len(n)
lastPP <- get("last_plot.phylo", envir = .PlotPhyloEnv)
y1 <- lastPP$yy[one2n]
o <- order(y1)
x <- if (style == "image") x[o, o]
else if (is.vector(x)) x[o]
else x[o, ]
nux <- length(ux <- unique.default(x))
x <- match(x, ux)
co <- funcol(nux)
rect(xl, yb, xr, yt, col = co[x], xpd = TRUE, ...)

This means that the colors provide by the user are assigned to the values of 
unique(x) *after* x is reordered internally by .matchDataPhylo and then again 
reordered x[o,], where o is the order of the tips of the tree in the plot, I 
believe. This is not something returned to the user, unfortunately, by 
plot.phylo, but is assigned to an hidden environment variable :
assign("last_plot.phylo", c(L, list(edge = xe, xx = xx, yy = yy)), 
envir = .PlotPhyloEnv)

These seems to make it next to impossible to get the right colors without just 
trying it out interactively. If anyone had any other alternatives I’d love to 
hear them.

I’ve tried making a little function:
getColFun<-function(x,phy,namedColors){
x <- ape:::.matchDataPhylo(x, phy)
n <- length(phy$tip.label)
one2n <- seq_len(n)
lastPP <- get("last_plot.phylo", envir = .PlotPhyloEnv)
y1 <- lastPP$yy[one2n]
o <- order(y1)
ux<-unique.default(x[o])
m<-match(as.character(ux),names(namedColors))
function(n){namedColors[m]}
}
But it’s a bit awkward because it relies on .PlotPhyloEnv which is not always 
available if you haven’t loaded the package, as well as the internal function 
.matchDataPhylo. This is problematic for putting it into a package. Is there a 
function I’m not aware of that would be helpful?

In terms of enhancement, it would be nice if instead phydataplot accepted a 
named vector of colors, where the vector of colors is required to have names 
that match the values of the data in x, and then the phydataplot internally 
would figure out how to match them together. Less desirable would be if the 
output of plot.phylo returned the information in ‘L’ that is saved in the 
.PlotPhyloEnv, then I could at least recreate a more stable version of my 
littl

[R-sig-phylo] possible bug in the phydataplot in ape package?

2017-05-23 Thread Elizabeth Purdom
Hello,

I am writing to the R-sig-phylo mailing list regarding what seems to be a bug 
in the `phydataplot` function in `ape`.

Specifically, if the style is `mosaic` but the data is a vector or 1-column 
matrix, the function fails. 

The following code is from the examples (that obviously works):
> tr <- rtree(n <- 30)
> p <- 5
> x <- matrix(sample(3, size = n*p, replace = TRUE), n, p)
> dimnames(x) <- list(paste0("t", 1:n), LETTERS[1:p])
> plot(tr, x.lim = 35, align.tip = TRUE, adj = 1)
> phydataplot(x, tr, "m", 2)

However, if I instead use only 1 column of x (either vector or force to remain 
a matrix):

> phydataplot(x[,1],tr,"m",2)
Error in seq.default(x0, x1, width) : invalid (to - from)/by in seq(.)
> phydataplot(x[,1,drop=FALSE],tr,"m",2)
Error in seq.default(x0, x1, width) : invalid (to - from)/by in seq(.)


This appears to be because of the following code within the function:
p <- ncol(x)
if (is.null(width)) {
x1 <- lastPP$x.lim[2]
width <- (x1 - x0)/p
} else x1 <- x0 + width * p
xx <- seq(x0, x1, width)

Since `x` is the output of `.matchDataPhylo(x, phy)`, it is always a vector, 
even if original x is a 1-column matrix, so that ncol(x) is NULL. Probably if 
there is a catch for when x is a vector to set p=1, then it would fix the 
problem, though I haven’t tested whether there are any further problems that 
come up.

All of the best,
Elizabeth Purdom

Here is my session info:
> sessionInfo()
R version 3.3.0 beta (2016-04-04 r70420)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.5 (Yosemite)

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] parallel  stats4stats graphics  grDevices utils datasets  
methods   base 

other attached packages:
 [1] clusterExperiment_1.3.1ape_4.1
SummarizedExperiment_1.4.0
 [4] Biobase_2.34.0 GenomicRanges_1.26.4   GenomeInfoDb_1.10.3  
 
 [7] IRanges_2.8.2  S4Vectors_0.12.2   BiocGenerics_0.20.0  
 
[10] devtools_1.12.0   

loaded via a namespace (and not attached):
 [1] nlme_3.1-131   bitops_1.0-6   matrixStats_0.52.2 bold_0.4.0
 doParallel_1.0.10 
 [6] RColorBrewer_1.1-2 progress_1.1.2 httr_1.2.1 prabclus_2.2-6
 tools_3.3.0   
[11] R6_2.2.0   DBI_0.6-1  lazyeval_0.2.0 colorspace_1.3-2  
 ade4_1.7-6
[16] trimcluster_0.1-2  nnet_7.3-12withr_1.0.2gridExtra_2.2.1   
 prettyunits_1.0.2 
[21] xml2_1.1.1 pkgmaker_0.22  diptest_0.75-7 scales_0.4.1  
 DEoptimR_1.0-8
[26] mvtnorm_1.0-6  robustbase_0.92-7  NMF_0.20.6 commonmark_1.2
 stringr_1.2.0 
[31] digest_0.6.12  XVector_0.14.1 limma_3.30.13  howmany_0.3-1 
 jsonlite_1.4  
[36] mclust_5.2.3   dendextend_1.5.2   dplyr_0.5.0RCurl_1.95-4.8
 magrittr_1.5  
[41] modeltools_0.2-21  Matrix_1.2-10  Rcpp_0.12.10   munsell_0.4.3 
 abind_1.4-5   
[46] viridis_0.4.0  stringi_1.1.5  whisker_0.3-2  MASS_7.3-47   
 zlibbioc_1.20.0   
[51] flexmix_2.3-14 MAST_1.0.5 plyr_1.8.4 grid_3.3.0
 crayon_1.3.2  
[56] rncl_0.8.2 lattice_0.20-35splines_3.3.0  uuid_0.1-2
 taxize_0.8.4  
[61] fpc_2.1-10 rngtools_1.2.4 reshape2_1.4.2 codetools_0.2-15  
 XML_3.98-1.7  
[66] RNeXML_2.0.7   data.table_1.10.4  foreach_1.4.3  testthat_1.0.2
 locfdr_1.1-8  
[71] gtable_0.2.0   tidyr_0.6.2reshape_0.8.6  kernlab_0.9-25
 assertthat_0.2.0  
[76] ggplot2_2.2.1  gridBase_0.4-7 phylobase_0.8.4xtable_1.8-2  
 roxygen2_6.0.1
[81] class_7.3-14   viridisLite_0.2.0  tibble_1.3.0   iterators_1.0.8   
 registry_0.3  
[86] memoise_1.1.0  cluster_2.0.6 
> 
[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/