This function intersects two horizon tables by harmonizing their depths and merging them where they overlap. This can be useful to rejoin the results of hz_dissolve()
to it's original horizon table, and then perform an aggregation on the dissolved variables.
hz_intersect(x, y, idcol = "id", depthcols = c("top", "bottom"))
A data.frame
with harmonized depth intervals (i.e. segment_id) and columns from both of the original data.frame
. If both data.frame
contain the same column names, they will both be returned (with the exception of the idcol and depthcols), and appended with either x or y to indicate which data.frame
they originated from.
a data.frame
a data.frame
character: column name of the pedon ID within the object.
a character vector of length 2 specifying the names of the horizon depths (e.g. c("top", "bottom")
).
Stephen Roecker
.
hz_dissolve()
, hz_lag()
, hz_segment()