climPlot: Binned scatter plot for 2-dimensional climate space

View source: R/climPlot.R

climPlotR Documentation

Binned scatter plot for 2-dimensional climate space

Description

Function to create a binned scatter plot of two climate variables.

Usage

climPlot(xy, x.binSize, y.binSize, x.name="V1", y.name="V2")

Arguments

xy

data.frame with cells as rows and 4 columns representing the present and future local values for the two variables (V1p, V1f, V2p, V2f).

x.binSize

numeric the bin size for the first variable.

y.binSize

numeric the bin size for the second variable.

x.name

character the variable name for the first variable. Used to label the plot.

y.name

character the variable name for the second variable. Used to label the plot.

Value

A series of plot objects displaying the (i) present and (ii) future cell frequency for each combination of local climates, and (iii) the location of remnant, novel and disappearing climates between both periods.

Author(s)

Jorge Garcia Molinos and Naoki H. Kumagai

See Also

dVoCC, climPCA

Examples


# Plot climate space for the two first variables(annual precipitation and maximum temperature)
xy <- na.omit(data.frame(getValues(JapTC[[1]]), getValues(JapTC[[2]]),
getValues(JapTC[[3]]), getValues(JapTC[[4]])))

out <- climPlot(xy, x.binSize = 5, y.binSize = 0.2, x.name="Precipitation (mm)",
y.name="Temperature max (°C)")

# output plots can be saved as:
ggplot2::ggsave(plot=out, filename=paste0(getwd(), "/example_plot.pdf"), width=17, height=17, unit="cm")



JorGarMol/VoCC documentation built on Aug. 17, 2022, 11:07 p.m.