This package implements spatial optimization algorithms across several problem families including contiguity-constrained regionalization, discrete facility location, market share analysis, and least-cost corridor and route optimization over raster cost surfaces. Facility location problems also accept user-supplied network travel-time matrices. Uses a Rust backend via extendr for graph and routing algorithms, and the HiGHS solver via the highs package for facility location mixed-integer programs. Method-level references are provided in the documentation of the individual functions.
This package aims to make NMR spectroscopy data analysis as easy as possible. It only requires a small set of functions to perform an entire analysis. Speaq offers the possibility of raw spectra alignment and quantitation but also an analysis based on features whereby the spectra are converted to peaks which are then grouped and turned into features. These features can be processed with any number of statistical tools either included in speaq or available elsewhere on CRAN.
Identify statistically significant flow clusters using the local spatial network autocorrelation statistic G_ij* proposed by Berglund and Karlström (1999) <doi:10.1007/s101090050013>. The metric, an extended statistic of Getis/Ord G ('Getis and Ord 1992) <doi:10.1111/j.1538-4632.1992.tb00261.x>, detects a group of flows having similar traits in terms of directionality. You provide OD data and the associated polygon to get results with several parameters, some of which are defined by spdep package.
SPINA (Structure Parameter Inference Approach) is a methodology to calculate constant structure parameters of endocrine homeostatic systems from steady-state hormone and metabolite concentrations. Methods and equations for thyroid homeostasis (SPINA Thyr) have been described in Dietrich et al. (2012) <doi:10.1155/2012/351864> and Dietrich et al. (2016) <doi:10.3389/fendo.2016.00057>, and for glucose homeostasis (SPINA Carb) in Dietrich et al. (2022) <doi:10.1038/s41598-022-22531-3> and Dietrich et al. (2024) <doi:10.1111/1753-0407.13525>.
Inferring causation from spatial cross-sectional data through empirical dynamic modeling (EDM), with methodological extensions including geographical convergent cross mapping from Gao et al. (2023) <doi:10.1038/s41467-023-41619-6>, geographical cross mapping cardinality as introduced by Lyu et al. (2026) <doi:10.1080/13658816.2026.2687121>, as well as the spatial causality test following the approach of Herrera et al. (2016) <doi:10.1111/pirs.12144>, together with geographical pattern causality proposed in Zhang & Wang (2025) <doi:10.1080/13658816.2025.2581207>.
The current version of this package estimates spatial autoregressive models for binary dependent variables using GMM estimators <doi:10.18637/jss.v107.i08>. It supports one-step (Pinkse and Slade, 1998) <doi:10.1016/S0304-4076(97)00097-3> and two-step GMM estimator along with the linearized GMM estimator proposed by Klier and McMillen (2008) <doi:10.1198/073500107000000188>. It also allows for either Probit or Logit model and compute the average marginal effects. All these models are presented in Sarrias and Piras (2023) <doi:10.1016/j.jocm.2023.100432>.
This package provides functions for Bayesian Predictive Stacking within the Bayesian transfer learning framework for geospatial artificial systems, as introduced in "Bayesian Transfer Learning for Artificially Intelligent Geospatial Systems: A Predictive Stacking Approach" (Presicce and Banerjee, 2025) <doi:10.48550/arXiv.2410.09504>. This methodology enables efficient Bayesian geostatistical modeling, utilizing predictive stacking to improve inference across spatial datasets. The core functions leverage C++ for high-performance computation, making the framework well-suited for large-scale spatial data analysis in parallel and distributed computing environments. Designed for scalability, it allows seamless application in computationally demanding scenarios.
Detect sample-provenance inconsistencies and potential mix-ups in mass-spectrometry-based plasma-proteome cohorts. Provides a clustering-based approach (build a nearest-neighbour graph in a dimensionality-reduced space and iteratively split large components by edge weight), a threshold-based approach (classify sample pairs as belonging or not-belonging from a pairwise distance cutoff), parameter optimization over distance metrics and cutoffs, and a pairwise random-forest classifier for protein importance ranking. This is a native R port of the author's Python package spqrp (<https://github.com/fhradilak/spqrp>), implementing methods from an associated manuscript currently in preparation.
This package provides a tool for survival analysis using a discrete time approach with ensemble binary classification. spect provides a simple interface consistent with commonly used R data analysis packages, such as caret', a variety of parameter options to help facilitate search automation, a high degree of transparency to the end-user - all intermediate data sets and parameters are made available for further analysis and useful, out-of-the-box visualizations of model performance. Methods for transforming survival data into discrete-time are adapted from the autosurv package by Suresh et al., (2022) <doi:10.1186/s12874-022-01679-6>.
SPIAT (**Sp**atial **I**mage **A**nalysis of **T**issues) is an R package with a suite of data processing, quality control, visualization and data analysis tools. SPIAT is compatible with data generated from single-cell spatial proteomics platforms (e.g. OPAL, CODEX, MIBI, cellprofiler). SPIAT reads spatial data in the form of X and Y coordinates of cells, marker intensities and cell phenotypes. SPIAT includes six analysis modules that allow visualization, calculation of cell colocalization, categorization of the immune microenvironment relative to tumor areas, analysis of cellular neighborhoods, and the quantification of spatial heterogeneity, providing a comprehensive toolkit for spatial data analysis.
This package implements the distance-adjusted propensity score with interference (iDAPS) and recoverU+ methods for estimating the average treatment effect on the treated (ATT) from spatial observational data in the presence of both spatial confounding and spatial interference. iDAPS matches units on a data-driven composite of propensity-score distance, spatial proximity and neighbourhood-exposure distance. recoverU+ is a doubly robust estimator that augments the propensity-score and control-outcome models with a partially recovered spatial confounder and a neighbourhood-exposure term. The package also provides the naive propensity score, DAPS and recoverU comparators, a simulator for the spatial confounding/interference data-generating process and spatial inference tools.
Fits spatial item factor analysis models for binary responses, following Chacón-Montalván, E. A., Parry, L., Giorgi, E., Torres, P., Orellana, J. D. Y., Moraga, P., and Taylor, B. M. (2025) <doi:10.1214/25-AOAS2072>, using full Bayesian inference via adaptive Metropolis-Hastings within Gibbs sampling and auxiliary variables with a probit link function. The latent factors are modelled as the sum of a predictor effect, a multivariate Gaussian process capturing spatial dependence, and a multivariate non-spatial term, allowing users to fit and predict spatially-referenced constructs such as food insecurity or socioeconomic indices. Standard exploratory and confirmatory item factor analysis are supported as particular cases, simply by dropping the spatial structure.
Inference based on models with or without spatially-correlated random effects, multivariate responses, or non-Gaussian random effects (e.g., Beta). Variation in residual variance (heteroscedasticity) can itself be represented by a mixed-effect model. Both classical geostatistical models (Rousset and Ferdy 2014 <doi:10.1111/ecog.00566>), and Markov random field models on irregular grids (as considered in the INLA package, <https://www.r-inla.org>), can be fitted, with distinct computational procedures exploiting the sparse matrix representations for the latter case and other autoregressive models. Laplace approximations are used for likelihood or restricted likelihood. Penalized quasi-likelihood and other variants discussed in the h-likelihood literature (Lee and Nelder 2001 <doi:10.1093/biomet/88.4.987>) are also implemented.
Implementation of SPECS, your favourite Single-Equation Penalized Error-Correction Selector developed in Smeekes and Wijler (2021) <doi:10.1016/j.jeconom.2020.07.021>. SPECS provides a fully automated estimation procedure for large and potentially (co)integrated datasets. The dataset in levels is converted to a conditional error-correction model, either by the user or by means of the functions included in this package, and various specialised forms of penalized regression can be applied to the model. Automated options for initializing and selecting a sequence of penalties, as well as the construction of penalty weights via an initial estimator, are available. Moreover, the user may choose from a number of pre-specified deterministic configurations to further simplify the model building process.
The developed package can be used to generate a spatial population for different levels of relationships among the dependent and auxiliary variables along with spatially varying model parameters. A spatial layout is designed as a [0,k-1]x[0,k-1] square region on which observations are collected at (k x k) lattice points with a unit distance between any two neighbouring points along the horizontal and vertical axes. For method details see Chao, Liu., Chuanhua, Wei. and Yunan, Su. (2018).<doi:10.1080/10485252.2018.1499907>. The generated spatial population can be utilized in Geographically Weighted Regression model based analysis for studying the spatially varying relationships among the variables. Furthermore, various statistical analysis can be performed on this spatially generated data.
This package provides publication-ready tables for descriptive statistics and regression models: frequency tables and cross-tabulations with association measures (Cramér's V, Kendall's Tau-b, and others), categorical and continuous summary tables, by group or from a complex survey design, and regression tables for one or more models side by side, across more than thirty model classes from mixed-effects to survival and Bayesian, with robust standard errors, average marginal effects, and univariable screening. Tables follow APA conventions by default, can switch to named journal styles such as JAMA, NEJM, or The Lancet, and render identically in the console and in gt', tinytable', flextable', Word', Excel', or the clipboard. Declared missing values in labelled data are honored and disclosed throughout the descriptive tables. Helpers cover codebooks, variable inspection, and row-wise summaries.
Calculates ratings for two-player or multi-player challenges. Methods included in package such as are able to estimate ratings (players strengths) and their evolution in time, also able to predict output of challenge. Algorithms are based on Bayesian Approximation Method, and they don't involve any matrix inversions nor likelihood estimation. Parameters are updated sequentially, and computation doesn't require any additional RAM to make estimation feasible. Additionally, base of the package is written in C++ what makes sport computation even faster. Methods used in the package refer to Mark E. Glickman (1999) <https://www.glicko.net/research/glicko.pdf>; Mark E. Glickman (2001) <doi:10.1080/02664760120059219>; Ruby C. Weng, Chih-Jen Lin (2011) <https://www.jmlr.org/papers/volume12/weng11a/weng11a.pdf>; W. Penny, Stephen J. Roberts (1999) <doi:10.1109/IJCNN.1999.832603>.
This package provides a toolbox for Sequential Probability Ratio Tests (SPRT) based on Wald (1945) <doi:10.2134/agronj1947.00021962003900070011x>. SPRTs are applied during the sampling process, ideally after each observation, and at every stage return a decision to either continue sampling or terminate and accept one of the specified hypotheses. The `seq_ttest()` function performs one-sample, two-sample, and paired t-tests for one- and two-sided hypotheses (Schnuerch & Erdfelder (2019) <doi:10.1037/met0000234>). The `seq_anova()` function performs a sequential one-way fixed effects ANOVA (Steinhilber et al. (2024) <doi:10.1037/met0000677>). The `plan_sample_size()` function helps plan sequential studies by simulating required sample sizes across a range of effect sizes. For more information, see the vignettes browseVignettes(package = "sprtt") or the package website <https://meikesteinhilber.github.io/sprtt/>.
Surface Protein abundance Estimation using CKmeans-based clustered thresholding ('SPECK') is an unsupervised learning-based method that performs receptor abundance estimation for single cell RNA-sequencing data based on reduced rank reconstruction (RRR) and a clustered thresholding mechanism. Seurat's normalization method is described in: Hao et al., (2021) <doi:10.1016/j.cell.2021.04.048>, Stuart et al., (2019) <doi:10.1016/j.cell.2019.05.031>, Butler et al., (2018) <doi:10.1038/nbt.4096> and Satija et al., (2015) <doi:10.1038/nbt.3192>. Method for the RRR is further detailed in: Erichson et al., (2019) <doi:10.18637/jss.v089.i11> and Halko et al., (2009) <doi:10.48550/arXiv.0909.4061>. Clustering method is outlined in: Song et al., (2020) <doi:10.1093/bioinformatics/btaa613> and Wang et al., (2011) <doi:10.32614/RJ-2011-015>.
This package provides a collection of functions to test and estimate Seemingly Unrelated Regression (usually called SUR) models, with spatial structure, by maximum likelihood and three-stage least squares. The package estimates the most common spatial specifications, that is, SUR with Spatial Lag of X regressors (called SUR-SLX), SUR with Spatial Lag Model (called SUR-SLM), SUR with Spatial Error Model (called SUR-SEM), SUR with Spatial Durbin Model (called SUR-SDM), SUR with Spatial Durbin Error Model (called SUR-SDEM), SUR with Spatial Autoregressive terms and Spatial Autoregressive Disturbances (called SUR-SARAR), SUR-SARAR with Spatial Lag of X regressors (called SUR-GNM) and SUR with Spatially Independent Model (called SUR-SIM). The methodology of these models can be found in next references Minguez, R., Lopez, F.A., and Mur, J. (2022) <doi:10.18637/jss.v104.i11> Mur, J., Lopez, F.A., and Herrera, M. (2010) <doi:10.1080/17421772.2010.516443> Lopez, F.A., Mur, J., and Angulo, A. (2014) <doi:10.1007/s00168-014-0624-2>.
Encapsulates a number of spatially balanced sampling algorithms, namely, Balanced Acceptance Sampling (equal, unequal, seed point, panels), Halton frames (for discretizing a continuous resource), Halton Iterative Partitioning (equal probability), Simple Random Sampling, Dynamic Assignment Sampling and Doubly balanced Dynamic Assignment Sampling. Robertson, B. L., Brown, J. A., McDonald, T. and Jaksons, P. (2013) <doi:10.1111/biom.12059>. Robertson, B. L., McDonald, T., Price, C. J. and Brown, J. A. (2017) <doi:10.1016/j.spl.2017.05.004>. Robertson, B. L., McDonald, T., Price, C. J. and Brown, J. A. (2018) <doi:10.1007/s10651-018-0406-6>. Robertson, B. L., van Dam-Bates, P. and Gansell, O. (2021a) <doi:10.1007/s10651-020-00481-1>. Robertson, B. L., Davies, P., Gansell, O., van Dam-Bates, P., McDonald, T. (2025) <doi:10.1111/anzs.12435>. Robertson, B.L., Price, C.J., Reale, M., Davies, P. (2026) <doi:10.1093/biomtc/ujag011>. Robertson, B.L., Price, C.J., Reale, M., Davies, P. (2026) <doi:10.1093/jssam/smag021>.
Functionality for spatio-temporal modeling of large data sets is provided. A Gaussian process in space and time is defined through a stochastic partial differential equation (SPDE). The SPDE is solved in the spectral space, and after discretizing in time and space, a linear Gaussian state space model is obtained. When doing inference, the main computational difficulty consists in evaluating the likelihood and in sampling from the full conditional of the spectral coefficients, or equivalently, the latent space-time process. In comparison to the traditional approach of using a spatio-temporal covariance function, the spectral SPDE approach is computationally advantageous. See Sigrist, Kuensch, and Stahel (2015) <doi:10.1111/rssb.12061> for more information on the methodology. This package aims at providing tools for two different modeling approaches. First, the SPDE based spatio-temporal model can be used as a component in a customized hierarchical Bayesian model (HBM). The functions of the package then provide parameterizations of the process part of the model as well as computationally efficient algorithms needed for doing inference with the HBM. Alternatively, the adaptive MCMC algorithm implemented in the package can be used as an algorithm for doing inference without any additional modeling. The MCMC algorithm supports data that follow a Gaussian or a censored distribution with point mass at zero. Covariates can be included in the model through a regression term.
High-performance spatial species accumulation curves using fixed-focus spatially constrained rarefaction, nearest-centroid expansion, and nearest-neighbor walks with a C++ backend for speed. Supports Hill numbers (q=0,1,2), beta diversity partitioning (turnover/nestedness) at site and pooled resolution, coverage-based rarefaction and extrapolation of alpha and beta diversity, phylogenetic diversity (PD; Faith's PD, EvoHeritage, mean pairwise distance, mean nearest taxon distance), functional diversity accumulation including aggregated functional diversity and intraspecific trait variation, phylogenetic and functional redundancy, interaction network accumulation, diversity-area relationships (DAR), endemism-area curves, sampling-effort correction and fragmentation analysis, species-area relationship (SAR) models based on extreme value theory (EVT), and area-based richness extrapolation via the total-species curve. Total richness is also estimated from frequency counts, including the accumulation rate curve estimator and an estimator for sites sampled without replacement, and shift-and-rotate null models test the position of a sampling design. Multiple starting points (seeds) provide uncertainty quantification. Methods are described in Chao et al. (2014) <doi:10.1890/13-0133.1>, Baselga (2010) <doi:10.1111/j.1466-8238.2009.00490.x>, Chao and Jost (2012) <doi:10.1890/11-1952.1>, Faith (1992) <doi:10.1016/0006-3207(92)91201-3>, Ma (2018) <doi:10.1002/ece3.4425>, Borda-de-Agua et al. (2025) <doi:10.1038/s41467-025-59239-7>, Hanski et al. (2013) <doi:10.1073/pnas.1311190110>, Jost (2007) <doi:10.1890/06-1736.1>, Ugland et al. (2003) <doi:10.1046/j.1365-2656.2003.00748.x>, Chao et al. (2023) <doi:10.1002/ecm.1588>, Chiu (2023) <doi:10.1111/2041-210X.14146>, Chiu et al. (2023) <doi:10.1098/rstb.2022.0183>, Rosindell et al. (2024) <doi:10.1093/sysbio/syad072>, Wojcik et al. (2024) <doi:10.1111/2041-210X.14470>, Ridder et al. (2024) <doi:10.1111/2041-210X.14443>, Jones et al. (2025) <doi:10.1111/ddi.70080>, and Shestopaloff (2025) <doi:10.1007/s10651-025-00644-y>.
Fast Multiplication and Marginalization of Sparse Tables <doi:10.18637/jss.v111.i02>.