| make_profile_array | R Documentation |
Each row of df_profiles (one profile) is expanded over a pF grid to
produce the [N_profiles * N_pf, K, p+1] array needed for dense
curve prediction.
make_profile_array(
df_profiles,
x_inputs,
scaler,
K = 64L,
knot_grid = seq(0, 1, length.out = K)
)
df_profiles |
Data frame with one row per profile (unique PEDON × depth combination). |
x_inputs |
Character vector of covariate names. |
scaler |
Fitted scaler from |
K |
Number of knots (default |
knot_grid |
Knot positions (default |
Named list:
Xseq3-D array [Np, K, p+1].
NpNumber of profiles.
pNumber of covariates.
df <- prepare_swrc_data(swrc_example, depth_col = "depth")
x <- c("clay", "silt", "bd_gcm3", "soc", "Depth_num")
sc <- fit_minmax(df, x)
# one row per horizon, de-duplicated: the covariates do not vary with pF
prof <- df[!duplicated(df[, c("PEDON_ID", "Depth_num")]), ]
a <- make_profile_array(prof, x, sc, K = 16L)
a$Np # profiles
a$p # covariates
dim(a$Xseq) # [Np, K, p + 1]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.