hzmetaname: Get or Set Horizon Metadata Column Name

hzmetanameR Documentation

Get or Set Horizon Metadata Column Name

Description

hzmetaname(): Get column name containing horizon data of interest

⁠hzmetaname<-⁠: Set horizon designation column name

Usage

## S4 method for signature 'SoilProfileCollection'
hzmetaname(object, attr, required = FALSE)

## S4 replacement method for signature 'SoilProfileCollection'
hzmetaname(object, attr, required = FALSE) <- value

Arguments

object

A SoilProfileCollection

attr

character. Base name for attribute to be stored in metadata. This is prefixed with "aqp_hz" for horizon-level metadata for column attributes. e.g. attr="clay" results in metadata value retrieved from "aqp_hzclay".

required

logical. Is this attribute required? If it is, set to TRUE to trigger error on invalid value.

value

character. Name of horizon-level column containing data corresponding to attr.

Details

Store the column name containing a specific type of horizon data in the metadata slot of the SoilProfileCollection.

See Also

guessHzAttrName()

Examples


data(sp1)

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

# set important metadata columns
hzdesgnname(sp1) <- "name"
hztexclname(sp1) <- "texture"

# set custom horizon property (clay content) column
hzmetaname(sp1, "clay") <- "prop"

# inspect metadata list
metadata(sp1)

# get horizon clay content column
hzmetaname(sp1, "clay")

# uses hzdesgname(), hztexclname(), hzmetaname(attr="clay") in function definition
estimatePSCS(sp1)

aqp documentation built on Oct. 19, 2024, 5:06 p.m.