Gets summary statistics of environmental variables (full and extracted by points) and also plot some graphics that helps to understand the data. It's mainly used by the var_leaflet function if the option to get an html summary is set to TRUE. However, it's also possible to use it individually, and also to produce interactive documents in R Markdown.

var_report(var, pts, mode, type = "rmd")

Arguments

var

A raster with the environmental variables.

pts

A data frame containing the presence/absence points. The first column should be longitude (x) and the sencond latitude (y). An additional collumn should be provided, coded as 0 (absence) and 1 (presence).

mode

Which type of result return:

  • "full.summary"A summary of each variable.

  • "pts.summary"A summary for each variable, extracted from the points.

  • "d.plots"Density plots for full data, presence data and absence data.

  • "pt.plots"Points plot with median and bars of mean+-SD.

  • "de.plots"Density plots of the full data only, but with points of presence-absence.

type

Which type of output for the summaries (either "rmd" for markdown tables or any other value for a list with the summaries as a data.frame).

Value

Summary statistics or plots.

Examples

library(sdmvis) data("pa_data") data("env_data") var_report(env_data, pa_data, mode = "d.plots")
#> Error in .local(.Object, ...):