soil: Soil Chemistry Properties Dataset

soilR Documentation

Soil Chemistry Properties Dataset

Description

Soil chemistry properties measured on a regular grid of 10 × 25 points, spaced by 5 meters. Each record contains the chemical composition and coordinates of the soil sample.

Usage

data(soil)

Format

A data.frame with 250 observations and 9 variables:

COORD.X

X coordinate of the sampling point.

COORD.Y

Y coordinate of the sampling point.

SAND

Proportion of sand in the soil sample.

SILT

Proportion of silt in the soil sample.

CLAY

Proportion of clay in the soil sample.

PHWATER

Soil pH measured in water.

CA

Calcium content of the soil.

MG

Magnesium content of the soil.

K

Potassium content of the soil.

Source

Bonat, W. H. (2018). "Multiple Response Variables Regression Models in R: The mcglm Package." Journal of Statistical Software, 84(4):1–30.

Examples

library(mcglm)
data(soil, package = "mcglm")

# Spatial model (tri2nb could be used but takes long)
Z1 <- mc_id(soil)

# Linear predictor example
form.ca <- CA ~ COORD.X*COORD.Y + SAND + SILT + CLAY + PHWATER
fit.ca <- mcglm(
  linear_pred = c(form.ca),
  matrix_pred = list(Z1),
  link = "log",
  variance = "tweedie",
  covariance = "inverse",
  power_fixed = TRUE,
  data = soil,
  control_algorithm = list(
    max_iter = 1000,
    tuning = 0.1,
    verbose = FALSE,
    tol = 1e-03
  )
)

mcglm documentation built on Jan. 9, 2026, 1:07 a.m.