SpatMCA is an R package designed for regularized maximum covariance analysis. It serves as a powerful tool for:
You can install the SpatMCA package using one of the following methods:
install.packages("SpatMCA")
# remotes::install_github("egpivo/SpatMCA")
install.packages("SpatMCA", repos = c('https://egpivo.r-universe.dev', 'https://cloud.r-project.org'))
Windows Users: Ensure that you have Rtools installed before proceeding with the installation.
Mac Users: You need Xcode Command Line Tools and should install the library gfortran. Follow these steps in the terminal:
brew update
brew install gcc
For a detailed solution, refer to this link, or download and install the library gfortran to resolve the "ld: library not found for -lgfortran" error.
To perform regularized maximum covariance analysis using SpatMCA, follow these steps:
library(SpatMCA)
spatmca(x1, x2, Y1, Y2, K = 1, num_cores = 1)
x1, x2: Location matrices.Y1, Y2: Data matrices.K: Number of patterns.num_cores: Number of CPU cores.Provides information about the identified patterns
Wang, W.-T. and Huang, H.-C. (2018). Regularized spatial maximum covariance analysis, Environmetrics, 29, https://doi.org/10.1002/env.2481
GPL (>= 2)
Wang W, Huang H (2025). _SpatMCA: Regularized Spatial Maximum Covariance Analysis_.
R package version 1.0.7, <https://github.com/egpivo/SpatMCA>.
@Manual{,
title = {SpatMCA: Regularized Spatial Maximum Covariance Analysis},
author = {Wen-Ting Wang and Hsin-Cheng Huang},
year = {2025},
note = {R package version 1.0.7},
url = {https://github.com/egpivo/SpatMCA},
}