Skip to contents

geosR is an R package with helpers for geostatistical analysis, spatial interpolation, and preliminary resource calculations. It wraps functions from gstat, sf, terra, and tmap.

The package is in development (0.0.0.9000). Check units, coordinate systems, and calculation assumptions before using outputs in a study.

Install

Install R and the system libraries required by sf and terra on your platform (GDAL, GEOS, and PROJ where applicable). Then run:

install.packages("remotes")
remotes::install_github("ghoziankarami/geosR", build_vignettes = FALSE)
library(geosR)

Building vignettes is optional and also requires knitr, rmarkdown, and Pandoc. Use build_vignettes = TRUE once those tools are installed.

Functions

Functions Purpose
fit_var(), est_krige() Variogram fitting and kriging.
calc_res(), ev_rest() Resource calculations and recovery adjustments.
plot_res() Spatial maps using tmap.
nscore(), backtr(), no_outlier() Distribution transformations and outlier handling.

Consult each function’s help page for argument names and units:

help("fit_var", package = "geosR")
help("calc_res", package = "geosR")

Tutorials and function reference are published through pkgdown. The vignette source is in vignettes/.

Repository

Path Contents
R/ Package functions.
man/ Function help files generated by roxygen2.
vignettes/ Tutorial sources.
analysis/ Worked analyses and supporting manuscripts.
.github/workflows/ Documentation build and contribution checks.

For local package checks:

git clone https://github.com/ghoziankarami/geosR.git
R CMD build geosR
R CMD check --no-manual geosR_0.0.0.9000.tar.gz

This package assists calculations; its outputs are not a certified resource or reserve statement. Independent geological and statistical review is required.

Contributing and license

Use GitHub Issues for reproducible bugs and CONTRIBUTING.md for pull requests. The code is licensed under MIT; see LICENSE.md.

Automated package checks

The R CMD check workflow installs the package and its dependencies, builds the vignette, and runs the package checks on Linux. Base-R tests in tests/known-answers.R cover normal scores, IQR filtering and reconciliation arithmetic using small deterministic inputs. The separate pkgdown workflow builds the documentation site; it does not replace package checks.

To reproduce the package check locally, use the R CMD build/check commands above. Broader kriging, grid geometry, units and cross-platform validation remain additional work; passing these initial tests does not establish scientific validity for every workflow.