Skip to contents

A subclass of cfp_profile() where each profile consists of layers that are defined by their upper and lower boundary without gaps or duplicates.

Usage

cfp_layered_profile(x, id_cols = NULL)

Arguments

x

A data.frame with columns upper and lower.

id_cols

Column names in data.frame that uniquely identify each profile.

Value

A cfp_layered_profile object. This is a [cfp_profile()] that is further subdivided into layers by the columns upper and lower.

Details

upper and lower define the upper and lower bounds of each layer in cm. Higher values lay on top of lower values.

See also

Other data formats: cfp_dat(), cfp_gasdata(), cfp_layers_map(), cfp_profile(), cfp_soilphys()

Examples

df <- data.frame(
  site = rep(c("site_a", "site_b"), each = 2),
  upper = c(10, 0, 7, 0),
  lower = c(0, -100, 0, -100),
  variable = 1:4)

cfp_layered_profile(df, id_cols = "site")
#> 
#> A cfp_layered_profile object 
#> id_cols: site 
#> 2  unique profiles 
#> 
#>     site upper lower variable
#> 1 site_a    10     0        1
#> 2 site_a     0  -100        2
#> 3 site_b     7     0        3
#> 4 site_b     0  -100        4