pdfs
combine to produce the reconstruction.R/plot.combinedPDFS.R
plot_combinedPDFs.Rd
Plot representing how the pdfs
combine to produce the reconstruction.
plot_combinedPDFs(
x,
ages = range(x$inputs$x),
samples = which(x$inputs$x >= min(ages) & x$inputs$x <= max(ages)),
climate = x$parameters$climate[1],
optima = TRUE,
xlim = NA,
only.present = FALSE,
only.selected = FALSE,
col = crestr::colour_theme(1),
save = FALSE,
filename = "samplePDFs.pdf",
as.png = FALSE,
png.res = 300,
width = 7.48,
height = 5
)
A crestObj
generated by the
crest.reconstruct
or crest
functions.
An age range to subset the samples to plot. By default, all the samples will be selected.
The list of sample indexes for which the plot should be plotted. All samples will be plotted by default.
The climate variable to use to plot the variable. Default is
first variable (x$parameters$climate\[1\]
).
A boolean to indicate whether to plot the optimum (TRUE
)
or the mean (FALSE
) estimates.
The climate range to plot the pdfs on. Default is the full range
used to fit the pdfs
(x$modelling$xrange).
A boolean to only add the names of the taxa recorded in
the sample (default FALSE
).
A boolean to only add the names of the selected taxa
(default FALSE
).
A range of colour values to colour the pdfs
. Colours will
be recycled to match the number of taxa.
A boolean to indicate if the diagram should be saved as a pdf file.
Default is FALSE
.
An absolute or relative path that indicates where the diagram
should be saved. Also used to specify the name of the file. Default:
the file is saved in the working directory under the name
'samplePDFs.pdf'
.
A boolean to indicate if the output should be saved as a png.
Default is FALSE
and the figure is saved as a pdf file.
The resolution of the png file (default 300 pixels per inch).
The width of the output file in inches (default 7.48in ~ 19cm).
The height of the output file in inches (default 5in ~ 12.7cm).
No return value, this function is used to plot.
if (FALSE) {
data(crest_ex)
data(crest_ex_pse)
data(crest_ex_selection)
reconstr <- crest(
df = crest_ex, pse = crest_ex_pse, taxaType = 0,
climate = c("bio1", "bio12"), bin_width = c(2, 20),
shape = c("normal", "lognormal"),
selectedTaxa = crest_ex_selection, dbname = "crest_example",
leave_one_out = FALSE
)
}
## example using pre-saved reconstruction obtained with the previous command.
data(reconstr)
plot_combinedPDFs(reconstr, ages=c(6,9), climate='bio12')