A selection of R packages I have developed. For other code and analysis scripts, see my GitHub profile.
An R package for estimating directions of variation in functional
data that exhibit sharp changes in smoothness. afpca
combines a fast, scalable adaptive scatterplot smoother with a
probabilistic FPCA framework, allowing each functional principal
component to be smoothed adaptively. This is particularly useful in
settings such as neural recordings, where sharp post-stimulus
transitions must be distinguished from smooth baseline behavior —
settings where standard global-smoothness assumptions fail.
Install the development version from GitHub:
# install.packages("devtools")
devtools::install_github("angelgar/afpca")
A quick visual tour. Below are example outputs from the package vignette. First, 20 simulated curves drawn from a mean function and two functional principal components with locally varying smoothness:
The estimated mean function and the first two adaptively-smoothed
functional principal components recovered by fpca.adapt() —
note how the estimator preserves sharp post-onset transitions rather
than over-smoothing them:
And two examples of observed curves alongside their reconstructions from the estimated components:
An R package for mass-univariate voxelwise analysis of NIfTI medical-imaging data, supporting general linear and generalized additive model workflows at the voxel level.
Install from CRAN:
install.packages("voxel")