MAPI_Plot2 {mapi} | R Documentation |
Function MAPI_Plot2
Description
Plot a MAPI analysis result with ggplot
Usage
MAPI_Plot2(
resu,
tails = NULL,
samples = NULL,
pal = c("#994000", "#CC5800", "#FF8F33", "#FFAD66", "#FFCA99", "#FFE6CC", "#FBFBFB",
"#CCFDFF", "#99F8FF", "#66F0FF", "#33E4FF", "#00AACC", "#007A99"),
shades = 20,
main = "",
upper = TRUE,
lower = TRUE,
upper.border = "black",
lower.border = "gray"
)
Arguments
resu |
A spatial object of class 'sf' resulting from a MAPI analysis done using
|
tails |
An optional spatial object of class 'sf' resulting from the post-process with
|
samples |
A data.frame with names and geographical coordinates of samples. Column names must be: 'ind', 'x', 'y'. Optional column 'errRad' with an error radius for sample locations (eg. GPS uncertainty). Coordinates must be projected (not latitude/longitude). |
pal |
A color ramp, eg. from RColorBrewer (default: orange > light gray > blue) |
shades |
Number of breaks for the color ramp (default 20) |
main |
Plot title (none by default) |
upper |
If TRUE and tails is not NULL, upper-tail significant areas are plotted. TRUE by default. |
lower |
If TRUE and tails is not NULL, lower-tail significant areas are plotted. TRUE by default. |
upper.border |
Border color of the upper-tail significant area. "black" by default. |
lower.border |
Border color of the lower-tail significant area. "gray" by default. |
Value
Returns the ggplot object.
Examples
## Not run:
library(ggplot2)
data("metric")
data("samples")
resu <- MAPI_RunAuto(samples, metric, crs=3857, nbPermuts = 1000)
tails <- MAPI_Tails(resu)
pl <- MAPI_Plot2(resu, tails=tails, samples=samples)
# Save to image
ggsave("mapiPlotOutput.png", plot=pl)
## End(Not run)