Function to create a binned scatter plot of two climate variables.
Arguments
- xy
data.framewith cells as rows and 4 columns representing the present and future local values for the two variables (V1p, V1f, V2p, V2f).- x.binSize
numericthe bin size for the first variable.- y.binSize
numericthe bin size for the second variable.- x.name
characterthe variable name for the first variable. Used to label the plot.- y.name
characterthe 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.
Examples
if (FALSE) { # \dontrun{
JapTC <- VoCC_get_data("JapTC.tif")
# Plot climate space for the two first variables(annual precipitation and maximum temperature)
xy <- stats::na.omit(data.frame(
terra::values(JapTC[[1]]),
terra::values(JapTC[[2]]),
terra::values(JapTC[[3]]), terra::values(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 = file.path(getwd(), "example_plot.pdf"),
width = 17, height = 17, unit = "cm"
)
} # }