cannot get graphic results to plot

31 views
Skip to first unread message

Peter Makovicky

unread,
May 4, 2025, 6:19:37 PMMay 4
to BioGeoBEARS
Hello,

I've been running BGB on calibrated trees of fossils, and am able to complete the analyses and get tables with results for each model and final comparisons between the paired basic and +j versions of each. However, I cannot get the routines for generating PDFs of the trees to work. Every time I try get the following error message:

> pdffn = "JL_BAYAREALIKE_vs_BAYAREALIKE+J_M3_stratified_v1.pdf"
> pdf(pdffn, width=12, height=24)
> analysis_titletxt ="BioGeoBEARS BAYAREALIKE on JL M3_stratified"
>
> # Setup
> results_object = resBAYAREALIKE
> scriptdir = np(system.file("extdata/a_scripts", package="BioGeoBEARS"))
>
> # States
> res2 = plot_BioGeoBEARS_results(results_object, analysis_titletxt, addl_params=list("j"), plotwhat="text", label.offset=0.45, tipcex=0.7, statecex=0.7, splitcex=0.6, titlecex=0.8, plotsplits=TRUE, cornercoords_loc=scriptdir, include_null_range=TRUE, tr=tr, tipranges=tipranges)
Error in (length(tr_pruningwise$tip.label) + 1):(length(tr_pruningwise$tip.label) +  :
  argument of length 0

A PDF file with the title listed above is generated, but is corrupted and cannot be opened with either Acrobat  or Preview.

Any tips or ideas of how to fix this?

Also os there a command to compile the individual analyses results into data tables such as those provided under the Results tab in the tutorial wiki?

Thanks in advance for help/ advice.

Peter Makovicky

unread,
May 4, 2025, 8:54:23 PMMay 4
to BioGeoBEARS
Hi again,

got the graphics working - just needed to close out and restart RStudio. Still interested to know if there is a way to output the sort of table available at https://github.com/jeetsukumaran/2015-SSB-AnnArbor-Biogeography/blob/master/biogeobears/results/Psychotria.DEC.areas.tsv ?

thanks in advance.

Nick Matzke

unread,
May 4, 2025, 9:27:31 PMMay 4
to bioge...@googlegroups.com
Hi!  You can get the table, which is just a table describing the nodes of the tree, with the prt() function (prt = print tree).

The rows of the table are ape package's node numbering scheme. The prt() function makes everything explicit, which is not the case for ape's tree structure. 

The BioGeoBEARS outputs of probabilities etc., in the BioGeoBEARS_results_objects, have the same row structure as the prt table. The columns are the different possible states/ranges.

Cheers!
Nick

--
You received this message because you are subscribed to the Google Groups "BioGeoBEARS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeobears...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/biogeobears/eeaaaef9-bbbe-442c-ad88-271cd0915db0n%40googlegroups.com.

Peter Makovicky

unread,
May 6, 2025, 1:43:49 PMMay 6
to BioGeoBEARS
Thanks! That's a very handy command.
Reply all
Reply to author
Forward
0 new messages