Learn R Programming

aqp (version 0.85)

initProfile: Initialise a SoilProfile Object

Description

Initialize a SoilProfile class object from a dataframe.

Usage

initProfile(d, depth_units = "cm", idcol = "id")

Arguments

d
an input dataframe representing a single soil profile
depth_units
unit of measure for depth values
idcol
a column used to uniquely define this profile from others

Value

  • An object of class 'SoilProfile'.

Details

This function is probably not all that useful, as most people will be working with several soil profiles at once. It will normally be called iteratvely by initProfileList.

References

http://casoilresource.lawr.ucdavis.edu/

See Also

profile_plot

Examples

Run this code
data(sp1)

# subset a single soil profile:
sp1.1 <- subset(sp1, subset=id == 'P001')

# convert into SoilProfile Class object:
sp1.1.sp <- initProfile(sp1.1)

# basic accessor functions (still in development)

# 1. get the depth (bottom of lowest horizon) from this object:
max(sp1.1.sp)

# 2. access the 2nd horizon:
sp1.1.sp[2, ]

# 3. access an attribute
sp1.1.sp[, 'name']

Run the code above in your browser using DataLab