All functions

IQR_SpatRaster()

This function computes interquartile range (IQR) for a SpatRaster

iqr_outliers()

This function computes interquartile range (IQR) criterion, which can be used as a criterion for outlier detection outlier_range_iqr <- c(range_IQR$1]- weightIQR x iqr, range_IQR(2)+ weightIQR x iqr) with range_IQR(1) the first quartile and range_IQR(2) the third quartile

alpha_metrics_sfs()

compute alpha metrics from list of spectral species distributions in the context of sequential feature selection

alphabeta_chunk()

apply alphabeta_window to a list of lists

alphabeta_window()

compute alpha and beta diversity metrics from pixel data corresponding to spectral species extracted from a window

alphabeta_window_classif()

compute alpha and beta diversity metrics from pixel data corresponding to spectral species extracted from a window

alphabeta_window_list()

apply alphabeta_window to a list of lists

alphabeta_window_sdm()

compute alpha and beta diversity metrics from pixel data corresponding to spectral species extracted from a window

apply_bigRaster()

This function performs big raster processing It requires user to write a function expecting vectors / matrices / dataframes corresponding to raster data read sequentially, a list of input files, a list of output files, and it is good to go.

apply_continuum_removal()

prepares data into list to apply continuum removal

apply_kmeans()

apply kmeans to information extracted from an image and corresponding to a window

apply_spectral_species()

compute spectral species from a raster

apply_spectral_species_plot()

apply biodivMapR to a set of plots identified by a field 'id' produced with preprocS2 function get_s2_tiling

bbox_to_poly()

converts a bbox to a polygon

beta_metrics_sfs()

compute beta metrics during sfs

biodivMapR()

computes diversity metrics from raster

biodivMapR_chunk()

apply biodivMapR (computes clusters + diversity metrics) to an image chunk

biodivMapR_classif()

computes diversity metrics from a classification raster containing information on a specific class for each pixel

biodivMapR_opt_clusters()

apply biodivMapR on a test set for different numbers of clusters

biodivMapR_sample()

sample pixels and plots to produce alpha and beta models, including clustering, dissimilarity & PCoA

biodivMapR_sdm()

computes diversity metrics from raster corresponding to SDM

biodivMapR_sfs()

performs SFS to identify combination of input variables maximizing a criterion

biodivMapR_tiles()

computes diversity metrics from raster

biodivMapR_tiling()

computes diversity metrics from a set of raster corresponding to tiles as produced with preprocS2

bray_curtis_dissimilarity()

Compute Bray-Curtis Dissimilarity

bray_curtis_turnover()

Compute Bray-Curtis Turnover

center_reduce()

center and reduce data matrix based on known mean and SD

check_data()

Checks if the data to be processed has the format type expected

clean_NAsInf()

cleans dataframe from NAs and Inf values

clean_tiff_list()

exclude .aux.xml and .tfw files from a list of files including .tif extension

compute_nn_from_ordination()

compute the nearest neighbors among kernels

compute_dissimilarity()

compute dissimilarity matrix corresponding to two distinct matrices, each of them including a list of samples (rows) defined by their spectral species (columns) metrics available: bray, brayturn, simpson_diss, jaccard, jaccardturn, sorensen

compute_mask_iqr()

compute mask based on interquartile range criterion applied on input rasters

compute_mask_iqr_tiles()

computes a mask for a collection of tiles based on interquartile range filtering interquartile is computed for all data included in teh collection samples out of a range defined by quartile_1-weightIQR x (quartile_3 - quartile_1) and quartile_3+weightIQR x (quartile_3-quartile_1) are then considered as outliers

continuumRemoval()

Continuum Removal

continuum_removal()

Computes continuum removal for matrix shaped data: more efficient than processing individual spectra the convex hull is based on the computation of the derivative between R at a given spectral band and R at the following bands

crfun()

computes continuum removal for individual spectra

crop_border_tile()

crop border of a spatRaster

define_grid()

define a grid over a raster

define_pixels_per_iter()

defines the number of pixels per iteration

biodivMapR_full() biodivMapR_full_tiles()

Deprecated functions in biodivMapR

exclude_spectral_domains()

define water vapor bands based on spectral sampling of original image

explore_cluster_range()

explore performances for a range of cluster number

explore_dissimilarity()

explore disimilarity metrics for a range of number of clusters

explore_kmeans()

Compute kmeans from random subset of pixels extracted from an image and a list of values for k

extract_from_rast_sfs()

extract informaton from raster to prepare for SFS

extract_svc_from_rast()

extract pixel information from a raster based on SpatVectorCollection

extract_vect_from_rast()

extract pixel information from a raster based on vector footprint

fd_metrics_sfs()

compute functional metrics during sfs

file_path_sans_ext()

Re-implementation of file_path_sans_ext in tools. This version can handle "." just before the file extenstion, unlike the original implementation. taken from https://github.com/cbig/zonator

filenames_explore_cluster_range()

checks if files produced from explore_cluster_range exist

filenames_opt_clusters()

checks if files produced from biodivMapR_opt_cluster exist

filter_prior_cr()

Filter data prior to continuum removal:

  • values are expected to be real reflectance values between 0 and 10000

  • negative values may occur, so a +100 value is applied to avoid negative

  • possibly remaining negative values are set to 0

  • constant spectra are eliminated

functional_window()

compute functional diversity metrics from pixel data corresponding to features extracted from a window

functional_window_list()

apply functional_window to a list of lists

get_hdr_name()

get hdr name from image file name

get_Hill()

computes hill number from a distribution The Hill numbers quantify biodiversity. The importance of the abundance distribution increases with increasing Hill order. For q=0, the Hill number is the richness, for q=1, it is the exponential Shannon entropy and for q=2, it is the inverse Simpson index. Note that the Hill order can also be a fraction, e.g. 0.5.

get_Shannon()

computes shannon index from a distribution (faster than version implemented in vegan package)

get_Simpson()

computes Simpson index from a distribution

get_alpha()

computes alpha diversity metrics from ssd_mat corresponding to iterations

get_alpha_from_ssd()

computes alpha diversity metrics from ssd

get_asset_path()

This function gets path from an asset in the JSON file

get_beta_from_ssd()

Computes beta diversity for a list of spectral species distributions

get_cluster_list()

get cluster list for biodivMapR_opt_clusters

get_date()

gets acquisition date from S2 image

get_diversity_from_plots()

computes diversity metrics from validation plots

get_diversity_from_plots_cluster()

computes diversity metrics from validation plots

get_functional_diversity()

get functional diversity metrics from dataframe This function was inspired from FD package

get_image_bands()

gets rank of spectral bands in an image

get_input_chunk()

get input chunk data from a list of rasters

get_kmeans()

computes k-means from nb_iter subsets defined from rast_sample

get_normalized_ssd()

get spectral species distribution for all clusters including those with 0 abundance

get_normalized_ssd_list()

get spectral species distribution from a list for all clusters including those with 0 abundance

get_normalized_ssd_mat()

get spectral species distribution for all clusters including those with 0 abundance

get_plot_list()

get a list of plots defined in a vector file defined as input

get_plots_from_tiles()

get samples for beta diversity mapping

get_raster_diversity()

Computes diversity metrics from raster data

get_raster_diversity_mw()

Computes diversity metrics from raster data based on moving window

get_raster_diversity_tile()

Computes diversity metrics from raster data

get_raster_extent()

gets raster extent

get_samples_from_plots()

extracts samples defined by a vector layer from a raster

get_samples_from_tiles()

get samples for alpha diversity mapping

get_si_tiles_from_raster()

computes spectral indices over a spatial extent from a raster

get_spectralSpecies()

compute spectral species from inputdata

get_stats_from_tiles()

get samples from tiles produced with preprocS2 function get_s2_tiling in order to produce stats

get_sunlitwindows()

eliminate windows with insufficient sunlit pixels

get_valid_pixels()

get valid pixels from a list of plots produced with preprocS2 function get_s2_tiling (notNA)

get_valid_pixels_from_tiles()

get valid pixels from list of tiles

get_xy_samples()

get xy of pixels to sample from raster

harmonize_envi_hdr()

Harmonize ENVI header file

init_PCoA()

initialize PCoA for beta diversity mapping

init_PCoA_samples()

initialize PCoA for beta diversity mapping based on samples extracted from images

init_kmeans()

Compute kmeans from random subset of pixels extracted from an image

init_kmeans_samples()

Compute kmeans from random subset of pixels extracted from an image

jaccard_dissimilarity()

Compute Jaccard Dissimilarity

jaccard_turnover()

Compute Jaccard Turnover

kmeans_iter()

computes kmeans for an iteration in biodivMapR

kmeans_progressr()

applies progression bar flr kmeans clustering

maxRows_chunk()

redefined chunks based on the max number of rows per chunk

maximize_sfs_criterion()

define variable maximizing a criterion

meters_to_decdeg()

Convert from meters to degrees correcting for global position borrowed from https://github.com/mlammens/occUncertain

mnf()

Function to perform MNF

mosaic_from_vrt()

mosaic tiles defined in vrt and compress if possible

mosaic_tiles()

produce a mosaic from a series of tiles

nbRows_chunk()

adjusts number of rows from chunks

noise()

gets noise

num2char()

converts numeric value to characters with specific lengths, adding 0 at beginning

pca()

performs PCA on matrix X

pco()

computes PCoA using the cmdscale function original source: package labdsv https://rdrr.io/cran/labdsv/src/R/pco.R

perform_PCA()

Performs PCA for all images and create PCA file with either all or a selection of PCs

print_error_message()

prints an error message if problems occur

produce_win_ID()

design a matrix with window ID based on an original raster and window size in pixels

radiometric_filtering()

Performs radiometric filtering based on three criteria: NDVI, NIR reflectance, Blue reflectance

radiometricfilter_chunk()

Performs radiometric filtering based on three criteria: NDVI, NIR reflectance, Blue reflectance

randperm()

performs random permutation for k samples among the vector defined by a

rast_sample_sfs()

extract informaton from raster to prepare for SFS

read_envi_header()

Reads ENVI hdr file

repmat()

R equivalent of repmat (matlab)

rm_invariant_bands()

remove constant bands

row_to_linear()

get max index for each row and convert into linear index

run_biodivMapR()

apply biodivMapR to an individual set of rasters (one site)

run_biodivMapR_plot()

apply biodivMapR to a set of plots identified by a field 'id' produced with preprocS2 function get_s2_tiling

sample_exact_raster()

sample exact number of pixels from a raster

sample_from_plots()

get samples for alpha and beta diversity mapping

sample_from_plots_alpha()

get samples for alpha diversity mapping

sample_from_plots_beta()

get samples for beta diversity mapping

sample_from_raster()

sample pixels or plots from raster data

sample_from_raster_coords()

sample set of pixels defined by row and col from raster data

sample_plots_from_raster()

sample pixels or plots from raster data

sample_raster()

sample pixels from raster data

save_diversity_maps()

save diversity maps as raster data

save_diversity_maps_mw()

save diversity maps as raster data once moving window process done

save_diversity_maps_tile()

save diversity maps as raster data

scatter_alphabeta()

produces a figure summarizing alpha and beta diversity on scatterplots

set_options_biodivMapR()

set options

simpson_dissimilarity()

Compute Simpson Dissimilarity

sorensen_dissimilarity()

Compute Sorensen Dissimilarity

spectral_species_full()

computes diversity metrics from raster

spectral_species_full_tiles()

computes spectral species from raster

spectralspecies_per_polygon()

get spectral species corresponding to polygons in a SpatVector object

spectralspecies_per_rast_sample()

get spectral species corresponding to raster sample extracted with extract

split_chunk()

split chunk into subsets to prepare for parallel processing

split_line()

split information from a line

update_mask_from_tiles()

update mask based on IQR for a series of rasters produced with preprocS2 function get_s2_tiling

weighted_coords_nn()

Compute weighted coordinates of a spatial unit based on nearest neighbors used during PCoA

which_alpha_beta()

identifies which alpha/beta metrics should be used for next processes

wrapperBig_PCA()

this function aims at applying PCA on a raster or list of rasters in combination with the function apply_bigRaster

write_envi_header()

writes ENVI hdr file