[R-sig-phylo] compar.ou in ape package - warnings and error messages on bird.orders example dataset

Anna Kostikova anna.kostikova at gmail.com
Tue Mar 2 16:33:35 CET 2010


Just to follow up the warnings and errors on compar.ou function, I've
tried to debug a bit a code, and found out that at least for the error
message (where node = -2 is specified), the problem seems to be
connected with the way function compar.ou process this bit of code:

>colnames(Wend) <- c(names(sort(bt[node])), as.character(root))

I am not sure why in the documentation example the node is set to -2,
but anyway, even if set to a particular node number (for bird.orders
corresponding node would be 25), the code still collapse at this
point, due to the fact that "node" should be a character, not numeric
vector.
So, it might be worth adding one line of code before, as to get a
correct result:

>node <- as.character(node)
>colnames(Wend) <- c(names(sort(bt[node])), as.character(root))

Please, correct me if I've got it wrong and I would be very glad to
hear opinions on that and also follow up on warnings (which are
connected with the way minimization is done, but I am not clear what
exactly goes wrong there).

Thanks a lot again,

Anna

2010/3/2 Anna Kostikova <anna.kostikova at gmail.com>:
> Dear list,
>
> When running compar.ou example from APE package documentation (v.
> 23-11-09), I've got couple of error messages.
> What might be the reason for them:
>
>> compar.ou(rnorm(23), bird.orders, alpha = 0.1)
> $deviance
> [1] 57.60627
>
> $para
>          estimate    stderr
> sigma2  0.71937096 0.1500408
> theta1 -0.04114436 0.1365702
>
> $call
> compar.ou(x = rnorm(23), phy = bird.orders, alpha = 0.1)
>
> attr(,"class")
> [1] "compar.ou"
> Warning messages:
> 1: In log(2 * pi * p[2]) : NaNs produced
> 2: In nlm(function(p) dev(c(alpha, p)), p = c(1, rep(mean(x), ncol(Wstart))),  :
>  NA/Inf replaced by maximum positive value
>
>> y <- c(rnorm(5, 0), rnorm(18, 5))
>> compar.ou(y, bird.orders, node = -2, alpha = .1)
> Error in dimnames(x) <- dn :
>  length of 'dimnames' [2] not equal to array extent
>
> Thanks a lot for any clue,
>
> Best regards,
> Anna
>



More information about the R-sig-phylo mailing list