Hi Rafael.

It seems to just be that some of the values in your data vector are NAs.

Try:

dat<-dat[!is.na(dat)]
tr<-drop.tip(tr,setdiff(tr$tip.label,names(dat)))
plotTree.wBars(tr,dat,type="fan",scale=0.1)

and you should obtain something that makes sense.

All the best, Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org

On 11/10/2017 6:04 PM, Rafael S Marcondes wrote:
Hi Liam,

Thanks for the quick reply. Playing with the scale argument didn't help. I have attached my script and environment.

Thanks,

*--
*
*Rafael Sobral Marcondes*
PhD Candidate (Systematics, Ecology and Evolution/Ornithology)

Museum of Natural Science <http://sites01.lsu.edu/wp/mns/>
Louisiana State University
119 Foster Hall
Baton Rouge, LA 70803, USA

Twitter: @rafmarcondes <https://twitter.com/rafmarcondes>


On Fri, Nov 10, 2017 at 5:25 PM, Liam J. Revell <liam.rev...@umb.edu <mailto:liam.rev...@umb.edu>> wrote:

    Hello Rafael.

    Have you tried adjusting the argument 'scale' which sets the factor
    by which x will be rescaled so that the tree & data can be plotted
    in the same space?

    Also, if you are just plotting a right-facing phylogram I recommend
    plotTree.barplot (also within phytools) which is in some ways more
    flexible & robust.

    Failing any of these options you are welcome to send me your saved
    workspace so I can investigate (& if there is a bug in phytools -
    fix it).

    All the best, Liam

    Liam J. Revell, Associate Professor of Biology
    University of Massachusetts Boston
    web: http://faculty.umb.edu/liam.revell/
    <http://faculty.umb.edu/liam.revell/>
    email: liam.rev...@umb.edu <mailto:liam.rev...@umb.edu>
    blog: http://blog.phytools.org

    On 11/10/2017 4:55 PM, Rafael S Marcondes wrote:

        Hi all,

        I'm encountering a little bump trying to use this really cool
        plot function
        in phytools and I can't figure out what's wrong:

            plotTree.wBars(tree=tr, x=dat)

        Error in plot.window(xlim = xlim, ylim = ylim, asp = asp) :
        need finite 'xlim' values

        Including an xlim argument doesn't work:

            plotTree.wBars(tree=tr, x=dat, xlim=c(0,100), ylim=c(0,100))

        Error in plot.window(xlim = xlim, ylim = ylim, asp = asp) :
        need finite 'xlim' values

        Thanks for any help!


        *--*
        *Rafael Sobral Marcondes*
        PhD Candidate (Systematics, Ecology and Evolution/Ornithology)

        Museum of Natural Science <http://sites01.lsu.edu/wp/mns/
        <http://sites01.lsu.edu/wp/mns/>>
        Louisiana State University
        119 Foster Hall
        Baton Rouge, LA 70803, USA

        Twitter: @rafmarcondes <https://twitter.com/rafmarcondes
        <https://twitter.com/rafmarcondes>>

                 [[alternative HTML version deleted]]

        _______________________________________________
        R-sig-phylo mailing list - R-sig-phylo@r-project.org
        <mailto:R-sig-phylo@r-project.org>
        https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
        <https://stat.ethz.ch/mailman/listinfo/r-sig-phylo>
        Searchable archive at
        http://www.mail-archive.com/r-sig-phylo@r-project.org/
        <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/

Reply via email to