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

RowToLinear()

get max index for each row and convert into linear index

WeightedCoordsNN()

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

alphabeta_window()

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

apply_continuum_removal()

prepares data to run multithreaded continuum removal

apply_kmeans()

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

biodivMapR_OptClusters()

explores performances of biodivMapR for different numbers of clusters

biodivMapR_SFS()

performs SFS to identify combination of input variables maximizing a criterion

biodivMapR_chunk()

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

biodivMapR_full()

computes diversity metrics from raster

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

compute_BCdiss()

compute bray curtis dissimilarity matrix corresponding to a list of kernels (rows) defined by their spectral species (columns) SSDList is a list containing spectral species distribution for two sets of kernels pcelim is the threshold for minimum contributin of a spctral species to be kept

compute_NN_from_ordination()

compute the nearest neighbors among kernels

compute_mask_IQR()

compute mask based on interquartile range criterion applied on input rasters

continuumRemoval()

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

define_pixels_per_iter()

defines the number of pixels per iteration

exclude_spectral_domains()

define Water Vapor bands based on spectral sampling of original image

explore_kmeans()

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

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

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 alpha and beta diversity metrics from pixel data corresponding to spectral species extracted from a window

functional_window_list()

apply functional_window to a list of lists

get_BCdiss()

Computes BC dissimilarity for a given matrix

get_BCdiss_from_SSD()

Computes BC dissimilarity for a list of spectral species distributions

get_HDR_name()

get hdr name from image file name, assuming it is BIL format

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_SSD_full()

get spectral species distribution for all clusters, even those with null abundance

get_Shannon()

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

get_Simpson()

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

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_date()

This function gets acquisition date from S2 image

get_diversity_from_plots()

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_kmeans()

computes k-means from nbIter subsets taken from dataPCA

get_raster_diversity()

Computes diversity metrics from raster data

get_raster_extent()

gets raster extent

get_spectralSpecies()

compute spectral species from inputdata

get_sunlitwindows()

eliminate windows with insufficient sunlit pixels

get_xy_samples()

get xy of pixels to sample from raster

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

kmeans_iter()

computes kmeans for an iteration in biodivMapR

kmeans_progressr()

applies results of ordination to full image based on nearest neighbors

maxRows_chunk()

redefined chunks based on the max number of rows per chunk

mnf()

Function to perform MNF

nbRows_chunk()

adjusts number of rows from chunks

noise()

this function

pca()

Function to perform PCA on a matrix

pco()

compute 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 original source: package labdsv https://rdrr.io/cran/labdsv/src/R/pco.R

read_ENVI_header()

Reads ENVI hdr file

repmat()

R equivalent of repmat (matlab)

rm_invariant_bands()

remove constant bands

sample_exact_raster()

sample exact number of pixels from a raster

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

scatter_alphabeta()

produces a figure summarizing alpha and beta diversity on scatterplots

select_PCA_components()

Check if principal components are properly selected as expected by the method

spectralspecies_per_polygon()

get spectral species corresponding to polygons in a SpatVector object

split_chunk()

split chunk into subsets to prepare for parallel processing

split_line()

ENVI functions

wrapperBig_PCA()

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