plot_loo | R Documentation |
Plot the results of the leave-one-out analysis.
plot_loo(
x,
optima = TRUE,
climate = x$parameters$climate[unlist(lapply(x$reconstructions, function(y)
return("loo" %in% names(y))))],
taxanames = x$inputs$taxa.name,
save = FALSE,
filename = "Diagram_loo.pdf",
as.png = FALSE,
png.res = 300,
width = 3.54,
height = 9,
yax_incr = NA,
bar_width = diff(range(x$inputs$x))/length(x$inputs$x),
xlim = NA,
tickAtSample = FALSE,
sort = NA,
filter = 0,
col_pos = "black",
col_neg = "grey80",
title = NA
)
x |
A data frame of the data to plot (first column with age or depth)
and the taxa in the following columns. x can also be a
|
optima |
A boolean to indicate whether to plot the optimum ( |
climate |
Climate variables to be used to generate the plot. By default all the variables are included. |
taxanames |
A list of taxa to use for the plot (default is all the recorded taxa). |
save |
A boolean to indicate if the diagram should be saved as a pdf file.
Default is |
filename |
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
|
as.png |
A boolean to indicate if the output should be saved as a png.
Default is |
png.res |
The resolution of the png file (default 300 pixels per inch). |
width |
The width of the output file in inches (default 3.54in ~ 9cm). |
height |
The height of the output file in inches (default 9in ~ 23cm). |
yax_incr |
Graphical parameters describing the increment size on the y-axis (default 5). |
bar_width |
Width of the bars of the barplot (default 1). |
xlim |
The range covered by the x-axis. Can be adjusted to get round numbers on the x-axis. If smaller than the range covered by the data, the data will be truncated (default: range of the data). |
tickAtSample |
Boolean that indicates whether a tick mark should be added
on the x-axis at the location of each sample (default |
sort |
A string to sort the order of the taxa from the highest to lowest
anomalies (sort='incr') or from the lowest to highest (sort='decr').
Use the default value |
filter |
A threshold value that determines the mean absolute anomaly value required for the taxon to be plotted (default 0 means that all taxa are plotted) |
col_pos |
Graphical parameter for the barplot. Colour of all the positive values (default black). |
col_neg |
Graphical parameter for the barplot. Colour of all the negative values (default grey80). |
title |
Name to be added on top of the plot (default |
When used with a crestObj, it returns the average leave-one-out values for each selected taxa
## Not run:
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"
)
reconstr <- loo(reconstr)
## End(Not run)
## example using pre-saved reconstruction obtained with the previous command.
data(reconstr)
loo_vals <- plot_loo(reconstr, yax_incr=c(0.5, 50), bar_width=0.8,
col_pos=c('blue','cornflowerblue'),
col_neg=c('red', 'goldenrod3'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.