h <- data.frame(
id = 1,
top = c(0, 25, 44, 46, 50),
bottom = c(25, 44, 46, 50, 100),
texcl = c("SL", "SL", "CL", "CL", "L"),
clay = c(10, 12, 27, 35, 16)
)
hz_lag(h)
hz_lag(h, -1)
hz_lag(h, 10:15, unit = "depth")
transform(cbind(h, lag = hz_lag(h)),
clay_dif = lag.clay_bot.1 - clay,
texcl_contrast = paste0(texcl, "-", lag.texcl_bot.1)
)
Run the code above in your browser using DataLab