| validate_data | R Documentation |
Checks that a data frame meets requirements for Soil Quality Index (SQI) computation: correct column types, sufficient sample sizes, absence of infinite values, and appropriate variable configuration.
validate_data(
data,
group_cols = NULL,
config = NULL,
min_n = 3,
verbose = TRUE
)
data |
A data frame. The first column(s) should be grouping factors (character or factor); remaining columns should be numeric soil variables. |
group_cols |
Character vector. Names of grouping columns (e.g.,
|
config |
A data frame produced by |
min_n |
Integer. Minimum number of observations per group. Default is 3. |
verbose |
Logical. If |
Invisibly returns a list with components:
Logical. TRUE if all checks pass.
Character vector of warning/info messages.
Data frame of group sizes.
Andrews, S.S., Karlen, D.L., & Cambardella, C.A. (2004). The soil management assessment framework: A quantitative soil quality evaluation method. Soil Science Society of America Journal, 68(6), 1945–1962. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2136/sssaj2004.1945")}
data(soil_data)
result <- validate_data(soil_data, group_cols = c("LandUse", "Depth"))
result$valid
result$n_per_group
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.