WollMilchSauPlot {ModelDataComp} | R Documentation |
Plots a pirateplot
with couulors according to model performance. The function can be used to compare means, distributions, and correlations (or any other metric from ObjFct
) between different datasets and models. Thus this plot is almost an "eier-legende Wollmichsau" (german, animal that produces eggs, wool, milk and meet) for model-data comparison. The plot is based on the function pirateplot
WollMilchSauPlot(x, ref = 1, objfct = "Cor", cols = NULL, brks = NULL, names = NULL, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, legend = TRUE, legend.only = FALSE, cut.min = NULL, cut.max = NULL, avg = TRUE, points = TRUE, bean = TRUE, inf = TRUE, bar = TRUE, ...)
x |
a data.frame with at least two columns |
ref |
Which column in x is the reference dataset? Also more than one reference can be provided, e.g. ref = c(1,2) will compute the objfct based on the combination of both datasets. |
objfct |
Which objective function metric should be used to create the colour palette? (see |
cols |
vector of colors from which the color palette should be interpolated |
brks |
break for colour scale |
names |
names of the datasets |
main |
title of the plot |
xlab |
label for x-axis |
ylab |
label for y-axis |
xlim |
limits for x-axis |
ylim |
limits for y-axis |
legend |
plot a legend? |
legend.only |
plot only a legend? |
cut.min |
Optional minimum value of the beans. |
cut.max |
Optional maximum value of the beans. |
avg |
plot average line? |
points |
plot points? |
bean |
plot beans (density estimates)? |
inf |
plot inference bands around mean? |
bar |
plot bars? |
... |
further arguments to |
No details.
Matthias Forkel <matthias.forkel@geo.tuwien.ac.at> [aut, cre]
No reference.
pirateplot
, ObjFct
, TaylorPlot
, WollMilchSauPlot
, ScatterPlot
# create some data obs <- rlnorm(500, 1, 1) # observations sim1 <- obs * rnorm(500, 1, 0.5) # similar to obs sim2 <- obs * rnorm(500, 1, 2) # less similar to obs sim3 <- obs * rnorm(500, 1, 4) # less similar to obs sim4 <- rlnorm(500, 1, 1) # same distribution but no correlation sim5 <- rnorm(500, 4.4, 2) # similar mean but different distribution x <- data.frame(obs, sim1, sim2, sim3, sim4, sim5) x[x < 0] <- 0 # default plot WollMilchSauPlot(x) # with different objective function as colour WollMilchSauPlot(x, objfct="IoA") WollMilchSauPlot(x, objfct="Pbias") WollMilchSauPlot(x, objfct="FV") # axis labels and title WollMilchSauPlot(x, ylab="Area (km2)", xlab="Groups", main="Comparison") # remove certain elements from plot WollMilchSauPlot(x, points=FALSE) WollMilchSauPlot(x, bean=FALSE) WollMilchSauPlot(x, points=FALSE, bean=FALSE) WollMilchSauPlot(x, points=FALSE, bean=FALSE, bar=FALSE) WollMilchSauPlot(x, inf=FALSE) WollMilchSauPlot(x, inf=FALSE, avg=FALSE) WollMilchSauPlot(x, avg=FALSE, bar=FALSE, inf=FALSE) # different color palettes WollMilchSauPlot(x, cols=c("blue", "red")) WollMilchSauPlot(x, cols=c("blue", "grey", "red")) WollMilchSauPlot(x, cols=rainbow(10)) WollMilchSauPlot(x, objfct="IoA", cols=heat.colors(5)) WollMilchSauPlot(x, objfct="RMSE", cols=rev(heat.colors(5))) # without legend (but using an objective function to colour) WollMilchSauPlot(x, legend=FALSE) # only legend WollMilchSauPlot(x, legend.only=TRUE) # without using an objective function - categorial colours WollMilchSauPlot(x, objfct=NULL) # different example data obs <- rnorm(500, 5, 1) sim1 <- obs * rnorm(500, 1, 0.2) # similar to obs sim2 <- obs * rnorm(500, 2, 1) # bias sim3 <- obs * rlnorm(500, 1, 0.1) # less similar to obs but highly correlated x <- data.frame(obs, sim1, sim2, sim3) WollMilchSauPlot(x)