Learn R Programming

aqp (version 2.1.0)

replaceHorizons<-: Replace Data in Horizon Slot

Description

Replaces horizon data with new data.frame object.

Usage

# S4 method for SoilProfileCollection
replaceHorizons(object) <- value

Arguments

object

A SoilProfileCollection

value

An object inheriting data.frame

Examples

Run this code

# load test data
data(sp2)

# promote to SPC
depths(sp2) <- id ~ top + bottom

# one profile
p <- sp2[1,]

# 23 variables in horizon data
length(horizonNames(sp2))

# remove all but essential ones
replaceHorizons(p) <- horizons(p)[,c(idname(p), hzidname(p), horizonDepths(p))]

# inspect result (a clean slate)
horizons(p)

Run the code above in your browser using DataLab