spatialEco R package with utilities to support spatial data manipulation, query, sampling and modeling. Functions include models for species population density, download utilities for climate and global deforestation spatial products, spatial smoothing, multivariate separability, point process model for creating pseudo- absences and sub-sampling, polygon and point-distance landscape metrics, auto-logistic model, sampling models, cluster optimization and statistical exploratory tools.
annulus.matrix-Creates a0,1 matrix based on defined annulus parameters, can be used as a window matrixin a raster focalfunction background-Creates a point sample that can be used as aNULLfor SDM's and other modeling approaches (see pseudo.absence for alternate approach).bearing.distance - Calculate new point based on bearing/distancebreeding.density - Calculates n-th percent breeding density areas base on a kernel density estimate of population counts.built.index - remote sensing built-up indexcgls_urls - Based on query, provide URL'sfor Copernicus Global Land Service datasetschae-The Canine-Human AgeEquivalent (for fun)classBreaks-for finding class breaksin a distributionclass.comparison-Compares two nominal rasters colinear-Testfor linear or nonlinear collinearity/correlationin data correlogram-Calculates and plots acorrelogram (spatially lagged correlations,"pearson","kendall" or"spearman")concordance-Performs a concordance/disconcordance (C-statistic) test on binomial models.conf.interval-Calculates confidence intervalfor the mean or median of a distribution with unknown population variance combine-Combines multiple rasters into an"all possible combinations" raster emulation the ESRI combinefunction, ratifies the output and includes a summary table of combinations and attributes that relates back to the raster values convexHull-Derives a convex hull of points using the alpha hull approach with adjustable tension. Please note that due to licensing reasons, thisfunction is only availablein the GitHub development version and not on CRAN. You must call thefunction from the package namespace using spatialEco:::convexHull crossCorrelation-Calculates the partial spatial cross-correlationfunctioncross.tab-Cross tabulate two rasters, labels outputscsi-Calculates the cosine similarity and angular similarity on two vectors or a matrixcurvature-Zevenbergen&Thorne, McNab's or Bolstad'ssurface (raster) curvature dahi-Calculates theDAHI (Diurnal Anisotropic Heat Index)date_seq-Creates date sequence, given defined start and stop dates, with optionsfor day, week, month, quarter, year or, minute. daymet.point-Downloads DAYMET climate variablesfor specified point and timeperioddaymet.tiles-Returns a vector of DAYMET tile id's within a specified extentdispersion - Calculates the dispersion ("rarity") of targets associated with planning unitsdissection - Evans (1972) Martonne's modified dissection divergence-Kullback-LeiblerDivergence (Cross-entropy) download.daymet-Batch download of daily gridded DAYMET climate data download.hansen-Download of Hansen Global Forest Change2000-2013 download.prism-Batch download of monthly gridded PRISM climate dataeffect.size-Cohen's-d effect size with pooled sd for a control and experimental grouperase.points - Erases points inside or outside a polygon feature classexplode - Explodes multi-part to single-part feature geometryextract.vertices - extracts (x,y) vertices coordinates from polygons and linesfocal.lmetrics (depreciated, moved to landmetrics package) - Landscape metrics using a focal windowfuzzySum - Calculates the fuzzy sum of a vectorgaussian.kernel - Creates a Gaussian Kernel of specified size and sigmageo.buffer - Buffers data in geographic coordinate space using a temporary projectiongroup.pdf - Creates a probability density plot of y for each group of xhexagons - Create hexagon polygon “fishnet” of defined size and extent.hli - Heat Load Index, now with support for southern hemisphere datahsp - Hierarchical Slope Positionhybrid.kmeans - Clustering using hierarchical clustering to define cluster-centers in k-meansidw.smoothing - Distance weighted smoothing (IDW) of a variable in a spatial point object. The function is a smoothing interpolator at the point observation(s) level using a distance-weighted mean.impute.loess - Imputes NA's or smoothsdata (or both)for a vector, intended mostlyfor time-series or serial data. insert-Inserts a row or column into a data.frameinsert.values-Inserts new values into a vector at specified positions is.empty-Method, evaluatesif vector is empty is.whole-Method, evaluatesif numeric vector is whole or float kendall-Kendall tau trend with continuity correctionfor time-serieskl.divergence-Calculates the Kullback-Leiblerdivergence (relative entropy) between unweighted theoretical component distributions. Divergence is calculated as:int [f(x) (logf(x)-logg(x)) dx]for distributions with densitiesf() andg(). knn-returns ids, rownames and distance of nearest neighborsintwo (or single) spatial objects. Optional radius distance constraint. Added optionalcovariates (weights).land.metrics (depreciated, moved to landmetrics package)-Calculates a variety of landscape metrics, on binary rasters,for polygons or points with a buffer distance. This is similar to the moving windowin Fragstats but, uses either a bufferfor each point or a zonal approach with polygons, to derive local metrics. libraries-Checkspackage(s) install, optionally installs and adds to namespace environmentlocal.min.max-Calculates the local minimums and maximumsin a numeric vector, indicating inflection pointsin the distribution. loess.boot-Bootstrap of a Local PolynomialRegression (loess)loess.ci-Calculates a local polynomial regression fit with associated confidence intervals logistic.regression-Performs alogistic (binomial) andautologistic (spatially lagged binomial) regression using maximum likelihood estimation or penalized maximum likelihood estimation.max_extent-Returns the maximum extent of multiple spatial inputsmoments-Calculate statistical moments of a distribution including percentiles, arithmetic-geometric-harmonic means, coefficient of variation, median absolute deviation, skewness, kurtosis, mode and number of modes. morans.plot-Autocorrelation plot nni-Calculates the nearest neighborindex (NNI) as a measure of clustering or dispersalnth.vlaue-Returns theNth (smallest/largest) valuesin a numeric vectoroli.aws-Download Landsat8-OLI from AWS. o.ring-Calculates the inhomogeneous O-ring point patternstatistic (Wiegand&Maloney2004) optimal.k-Find optimal k of k-Medoid partitions using silhouette widths optimized.sample.variance-Draws an optimal sample that minimizes or maximizes the sample variance outliers-Identify outliers using modified Z-score overlap-For comparing the similarity of two niche estimates using Warren's-Iparea.sample - Creates a systematic or random point sample of polygons where n is based on percent area of each polygonparse.bits - Based on integer value, pulls value(s) of specified bit(s)parial.cor - Partial and Semi-partial correlationplot.effect.size - Plot generic for effect sizeplot.loess.boot - Plot generic for loess bootpoint.in.poly - Intersects point and polygon feature classes and adds polygon attributes to the pointspolygon_extract - Fast method for extracting raster values to polygonspolyPerimeter - Calculates the perimeter length(s) for a polygon objectpoly.regression - smoothing data in time-series and imputing missing (NA) values using polynomial regressionpp.subsample - Generates random subsample based on point process intensity function of the observed data. This is a spatially informed data thinning model that can be used to reduce pseudo-replication or autocorrelation.proximity.index - Proximity index for a set of polygonspseudo.absence - Generates pseudo-absence samples based on the spatial intensity function of known species locations. This is akin to distance constrained but is informed by the spatial process of the observed data and is drawn from a probabilistic sample following the intensity function.quadrats - Quadrat sampling or analysis, variable size and angle optionsrandom.raster - creates random rasters or stacks of defined dimensions and statistical distributionsraster.change - Compares two categorical rasters with a variety of statistical optionsraster.deviation - Local deviation from the raster based on specified global statistic or a polynomial trend.rasterDistance - This replicates the raster distanceFromPoints function but uses the Arya & Mount Approximate Near Neighbor (ANN) C++ library for calculating distances. Where this results in a notable increase in performance it is not memory safe, needing to read in the entire raster and does not use the GeographicLib (Karney, 2013) spheroid distance method for geographic data.raster.downscale - Downscale raster to a higher resolution raster using robust regressionraster.entropy - Calculates entropy on integer raster (i.e., 8 bit 0-255)raster.gaussian.smooth - Applies a Gaussian smoothing kernel to smooth raster.raster.invert - Inverts value of a rasterraster.kendall - Calculates Kendall's tau trend with continuity correctionfor raster time-seriesraster.mds-Multidimensional scaling of raster values within an N x N focal window raster.modified.ttest-Bivariate moving window correlation using Dutilleul's modified t-testraster.moments - Calculates focal statistical moments of a rasterraster.transformation - Applies specified statistical transformation to a rasterraster.vol - Calculates a percent volume on a raster or based on the entire raster or a systematic sampleraster.Zscore - Calculates the modified z-score for all cells in a rasterrasterCorrelation - Performs a simple moving window correlation between two rastersremove.holes - Removes all holes (null geometry) in polygon sp class objectsrotate.polygon - Rotates a polygon by specified anglesa.trans - Trigonometric transformation of a slope and aspect interactionsample.annulus - Creates sample points based on annulus with defined inner and outer radiussample.line - Creates a systematic or random point sample of an sp SpatialLinesDataFrame object based on distance spacing, fixed size or proportional sizesample.poly - Creates an equal sample of n for each polygon in an sp Polygon class objectsampleTransect - Creates random transects from points and generates sample points along each transectseparability - Calculates variety of univariate separability metrics for nominal class samplesspectral.separability - Calculates univariate or multivariate separability for nominal class samplessg.smooth - Smoothing time-series data using a Savitzky-Golay filtershannons - Calculates Shannon's Diversity Index and Shannon's Evenness Indexshift - Shifts a vector by n lags without changing its length, can specify fill valuessimilarity - Uses row imputation to identify "k" ecological similar observationssmooth.time.series - Smoothing and imputing missing (NA) of pixel-level data in raster time-series using (local polynomial) LOESS regressionsobal - Applies an isotropic image gradient operator (Sobel-Feldman) using a 3x3 windowspatial.select - Performs a spatial select (feature subset) similar to ArcGISspectral.separability - Calculates class-wise multivariate spectral separabilitysp.kde - A weighted or un-weighted kernel density estimatesp.na.omit - Removes row or column NA'sin sp object. The standard R na.omitfunction will not propagate through all slots of an sp class object. Thisfunction removes the spatial objects,in all slots, corresponding to NA's in the @data data.frame object.srr - Surface Relief Ratiostratified.random - Creates a stratified random sample of an sp class object using a factor.subsample.distance - Minimum, and optional maximum, distance constrained sub-samplingswvi - Senescence weighted MSAVI or MTVItime_to_event - Returns the time (sum to position) to a specified valuetopo.distance - Calculates topographic corrected distance for a SpatialLinesDataFrame objecttpi - Calculates topographic position using mean deviations within specified windowtrasp - Solar-radiation Aspect Indextrend.line - Calculated specified (linear, exponential, logarithmic, polynomial) trend line of x,y and plots results.tri - Implementation of the Riley et al (1999) Terrain Ruggedness Indexvrm - Implementation of the Sappington et al., (2007) vector ruggedness measurewinsorize - Removes extreme outliers using a winsorization transformationwt.centroid - Creates centroid of [x,y] coordinates, of a random field, based on a weights field in a point sample.zonal.stats - Polygon "zonal" statistics of a raster. Function can accept custom “vectorized” function.Bugs: Users are encouraged to report bugs here. Go toissues in the menu above, and press new issue to start a new bug report, documentation correction or feature request. You can direct questions tojeffrey_evans@tnc.org.
To installspatialEco in R use install.packages() to download current stable release from CRAN
or, for the development version, run the following (requires the remotes package):remotes::install_github("jeffreyevans/spatialEco")