| Title: | Statistical and Machine Learning Engine for Long-Term Natural Resource Management Data |
|---|---|
| Description: | A comprehensive toolkit for statistical and machine learning-based analysis of long-term Natural Resource Management (NRM) datasets. Integrates formula-driven approaches, statistical inference, and machine learning (ML) models for advanced analytics. Modules cover trend and structural analysis (Mann-Kendall test, slope estimation, Chow test, structural break detection), multivariate system modelling (Partial Least Squares (PLS), Structural Equation Modelling (SEM)), response curve optimisation, time-series forecasting (Autoregressive Integrated Moving Average (ARIMA), hybrid models), panel data and treatment effects (Difference-in-Differences (DiD), causal machine learning), uncertainty and sensitivity analysis (bootstrap, Monte Carlo, Bayesian), and automated model selection and performance comparison. Designed for long-term datasets covering soil, water, crop, and climate domains. Key references: Mann and Kendall (1945) <doi:10.2307/1907187>; Sen (1968) <doi:10.1080/01621459.1968.10480934>; Bai and Perron (2003) <doi:10.1002/jae.659>; Rosseel (2012) <doi:10.18637/jss.v048.i02>; Croissant and Millo (2008) <doi:10.18637/jss.v027.i02>. |
| Authors: | Sadikul Islam [aut, cre, cph] (ORCID: <https://orcid.org/0000-0003-2924-7122>) |
| Maintainer: | Sadikul Islam <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.4 |
| Built: | 2026-06-07 21:11:41 UTC |
| Source: | https://github.com/cran/NRMstatsML |
A comprehensive R package for statistical and machine learning-based analysis of long-term Natural Resource Management (NRM) datasets. It integrates formula-driven approaches, statistical inference, and machine learning models for advanced analytics across soil, water, crop, and climate domains.
Trend and structural analysis: Mann-Kendall test,
Sen's slope, structural break detection (Chow, Bai-Perron), and ML-based
trend prediction. See nrm_trend, nrm_mann_kendall.
Multivariate system modelling: regression, PLS,
SEM, and ML feature selection. See nrm_multivariate,
nrm_pls.
Response curve and input optimisation: quadratic
and nonlinear regression. See nrm_response_curve,
nrm_optimize_input.
Time series forecasting: ARIMA, SARIMA, LSTM, and hybrid
models. See nrm_forecast, nrm_arima.
Panel data and treatment effects: fixed/random effects,
DiD, causal ML. See nrm_panel, nrm_did.
Uncertainty and sensitivity analysis: bootstrap,
Monte Carlo, Bayesian modelling. See nrm_uncertainty,
nrm_bootstrap.
Automated model selection, tuning, and benchmarking.
See nrm_automl, nrm_benchmark.
Validate and prepare data with nrm_data_check.
Run trend analysis with nrm_trend or
nrm_mann_kendall.
Fit models with the relevant module function.
Summarise results with nrm_summary.
Visualise with nrm_plot.
Maintainer: Sadikul Islam [email protected] (ORCID) [copyright holder]
Mann, H. B. (1945). Nonparametric tests against trend. Econometrica, 13, 245–259.
Sen, P. K. (1968). Estimates of the regression coefficient based on Kendall's tau. Journal of the American Statistical Association, 63, 1379–1389.
Fits an ARIMA model with automatic order selection via forecast.
nrm_arima(data, value_var, time_var = "year", seasonal = TRUE, frequency = 1L)nrm_arima(data, value_var, time_var = "year", seasonal = TRUE, frequency = 1L)
data |
A data frame ordered by time. |
value_var |
Character. Column to forecast. |
time_var |
Character. Time index column. Default |
seasonal |
Logical. If |
frequency |
Integer. Seasonal frequency (e.g. |
A list of class "nrm_arima" with the fitted model and AIC/BIC.
data(nrm_example) ar <- nrm_arima(nrm_example, value_var = "crop_yield") print(ar)data(nrm_example) ar <- nrm_arima(nrm_example, value_var = "crop_yield") print(ar)
Trains multiple model types via caret, selects the best model by cross-validated Root Mean Square Error (RMSE), and returns a ranked comparison table.
nrm_automl( data, formula, methods = c("lm", "rf", "gbm", "svmRadial"), cv_folds = 5L, seed = 42L )nrm_automl( data, formula, methods = c("lm", "rf", "gbm", "svmRadial"), cv_folds = 5L, seed = 42L )
data |
A data frame. |
formula |
A model formula. |
methods |
Character vector of caret method names to compare.
Default: |
cv_folds |
Integer. Number of cross-validation folds. Default |
seed |
Integer. Random seed for reproducibility. Default |
A list of class "nrm_automl" with:
best_modelThe best-performing trained caret model.
best_methodName of the best method.
leaderboardData frame ranking all methods by Root Mean Square Error (RMSE).
modelsNamed list of all fitted models.
data(nrm_example) am <- nrm_automl(nrm_example, formula = crop_yield ~ N + P + K + rainfall, methods = c("lm", "rf"), cv_folds = 5) nrm_summary(am)data(nrm_example) am <- nrm_automl(nrm_example, formula = crop_yield ~ N + P + K + rainfall, methods = c("lm", "rf"), cv_folds = 5) nrm_summary(am)
Evaluates a set of model objects against a hold-out test set and computes Root Mean Square Error (RMSE), Mean Absolute Error (MAE), and R-squared.
nrm_benchmark(models, test_data, response_var)nrm_benchmark(models, test_data, response_var)
models |
A named list of fitted model objects that support
|
test_data |
A data frame (the hold-out set). |
response_var |
Character. Name of the response variable in
|
A list of class "nrm_benchmark" containing a data frame
metrics with Root Mean Square Error (RMSE), Mean Absolute Error
(MAE), and R-squared, ranked by RMSE.
data(nrm_example) n <- nrow(nrm_example) train <- nrm_example[seq_len(floor(0.8 * n)), ] test <- nrm_example[seq(floor(0.8 * n) + 1L, n), ] m1 <- lm(crop_yield ~ N + P + K, data = train) bm <- nrm_benchmark(list(ols = m1), test_data = test, response_var = "crop_yield") print(bm)data(nrm_example) n <- nrow(nrm_example) train <- nrm_example[seq_len(floor(0.8 * n)), ] test <- nrm_example[seq(floor(0.8 * n) + 1L, n), ] m1 <- lm(crop_yield ~ N + P + K, data = train) bm <- nrm_benchmark(list(ols = m1), test_data = test, response_var = "crop_yield") print(bm)
Estimates confidence intervals for a user-defined statistic via non-parametric bootstrapping using boot.
nrm_bootstrap(data, stat_fn, n_iter = 1000L, alpha = 0.05, ...)nrm_bootstrap(data, stat_fn, n_iter = 1000L, alpha = 0.05, ...)
data |
A data frame. |
stat_fn |
A function that takes a data frame and returns a single
numeric value (or named numeric vector). Must accept a |
n_iter |
Integer. Number of resamples / simulations. Default |
alpha |
Numeric. Significance level for confidence intervals. Default |
... |
Additional arguments passed to |
A list of class "nrm_bootstrap" with mean,
sd, ci, and raw (the boot object).
data(nrm_example) bs <- nrm_bootstrap(nrm_example, stat_fn = function(d) mean(d$crop_yield), n_iter = 500) print(bs)data(nrm_example) bs <- nrm_bootstrap(nrm_example, stat_fn = function(d) mean(d$crop_yield), n_iter = 500) print(bs)
Checks a data frame for missing values, type consistency, and expected columns for NRM analysis. Returns a structured report.
nrm_data_check(data, time_var = "year", verbose = TRUE)nrm_data_check(data, time_var = "year", verbose = TRUE)
data |
A data frame, ideally containing columns such as |
time_var |
Character. Name of the time column. Default |
verbose |
Logical. Print report to console. Default |
A list (invisibly) with components n_rows, n_cols,
missing_summary, numeric_cols, and warnings.
data(nrm_example) nrm_data_check(nrm_example)data(nrm_example) nrm_data_check(nrm_example)
Estimates the average treatment effect on the treated (ATT) using a two-period, two-group Difference-in-Differences (DiD) design appropriate for policy or intervention evaluation in Natural Resource Management (NRM) contexts.
nrm_did(data, outcome, treat_var, time_var, covariates = NULL)nrm_did(data, outcome, treat_var, time_var, covariates = NULL)
data |
A data frame. |
outcome |
Character. Outcome variable name. |
treat_var |
Character. Binary treatment indicator (0/1). |
time_var |
Character. Binary post-period indicator (0/1). |
covariates |
Character vector of additional control variable names.
Default |
A list of class "nrm_did" with:
attAverage treatment effect on the treated (ATT).
modelThe underlying lm object.
p_valueP-value of the DiD interaction term.
set.seed(42) d <- data.frame( crop_yield = c(rnorm(20, 3.5, 0.4), rnorm(20, 4.2, 0.4)), treatment = rep(c(0L, 1L), each = 20), post = rep(c(0L, 1L, 0L, 1L), each = 10) ) did <- nrm_did(d, outcome = "crop_yield", treat_var = "treatment", time_var = "post") print(did)set.seed(42) d <- data.frame( crop_yield = c(rnorm(20, 3.5, 0.4), rnorm(20, 4.2, 0.4)), treatment = rep(c(0L, 1L), each = 20), post = rep(c(0L, 1L, 0L, 1L), each = 10) ) did <- nrm_did(d, outcome = "crop_yield", treat_var = "treatment", time_var = "post") print(did)
A synthetic dataset mimicking 20 years of a long-term fertiliser experiment covering crop yield, soil properties, nutrient inputs, and climate variables. Generated for illustration and testing purposes only.
nrm_examplenrm_example
A data frame with 20 rows and 10 variables:
Integer. Year of observation (2000–2019).
Character. Treatment label ("control" or
"NPK").
Numeric. Grain yield (t/ha).
Numeric. Soil organic carbon (%).
Numeric. Nitrogen applied (kg/ha).
Numeric. Phosphorus applied (kg/ha).
Numeric. Potassium applied (kg/ha).
Numeric. Annual rainfall (mm).
Numeric. Annual runoff (mm).
Numeric. Total biomass (t/ha).
Synthetically generated; not derived from any real experiment.
data(nrm_example) head(nrm_example) nrm_data_check(nrm_example)data(nrm_example) head(nrm_example) nrm_data_check(nrm_example)
High-level wrapper that fits an ARIMA or hybrid ARIMA+ML model and returns a forecast with confidence intervals.
nrm_forecast( data, value_var, time_var = "year", horizon = 5L, method = "auto_arima", frequency = 1L )nrm_forecast( data, value_var, time_var = "year", horizon = 5L, method = "auto_arima", frequency = 1L )
data |
A data frame ordered by time. |
value_var |
Character. Column to forecast. |
time_var |
Character. Time index column. Default |
horizon |
Integer. Forecast horizon (number of time steps). Default |
method |
Character. |
frequency |
Integer. Seasonal frequency (e.g. |
A list of class "nrm_forecast" with:
forecastThe forecast object.
methodMethod used.
horizonForecast horizon.
accuracyIn-sample accuracy metrics.
data(nrm_example) fc <- nrm_forecast(nrm_example, value_var = "crop_yield", horizon = 5) nrm_plot(fc)data(nrm_example) fc <- nrm_forecast(nrm_example, value_var = "crop_yield", horizon = 5) nrm_plot(fc)
Applies the Mann-Kendall nonparametric test for monotonic trend in a time series. Suitable for non-normally distributed and autocorrelated data typical in long-term NRM records.
nrm_mann_kendall(data, time_var = "year", value_var, alpha = 0.05)nrm_mann_kendall(data, time_var = "year", value_var, alpha = 0.05)
data |
A data frame containing at least the columns specified by
|
time_var |
Character. Name of the column holding the time index
(e.g. |
value_var |
Character. Name of the column holding the response variable
(e.g. |
alpha |
Numeric. Significance level for the Mann-Kendall test.
Default |
A list of class "nrm_mann_kendall" with components:
tauKendall's tau statistic.
p_valueTwo-sided p-value.
significantLogical; TRUE when p < alpha.
trend_directionCharacter: "increasing",
"decreasing", or "no trend".
rawFull output from MannKendall.
Mann, H. B. (1945). Nonparametric tests against trend. Econometrica, 13, 245–259.
Kendall, M. G. (1975). Rank Correlation Methods. Griffin.
data(nrm_example) mk <- nrm_mann_kendall(nrm_example, time_var = "year", value_var = "crop_yield") print(mk)data(nrm_example) mk <- nrm_mann_kendall(nrm_example, time_var = "year", value_var = "crop_yield") print(mk)
Generates Monte Carlo samples by adding Gaussian noise (scaled to the column-wise standard deviation) to each numeric column and evaluates the statistic of interest across simulations.
nrm_monte_carlo( data, stat_fn, n_iter = 1000L, alpha = 0.05, noise_sd = 0.1, ... )nrm_monte_carlo( data, stat_fn, n_iter = 1000L, alpha = 0.05, noise_sd = 0.1, ... )
data |
A data frame. |
stat_fn |
A function that takes a data frame and returns a single
numeric value (or named numeric vector). Must accept a |
n_iter |
Integer. Number of resamples / simulations. Default |
alpha |
Numeric. Significance level for confidence intervals. Default |
noise_sd |
Numeric. Scale factor applied to column standard deviations
when generating noise. Default |
... |
Additional arguments passed to |
A list of class "nrm_monte_carlo" with mean,
sd, ci, and samples.
data(nrm_example) mc <- nrm_monte_carlo(nrm_example, stat_fn = function(d) mean(d$crop_yield), n_iter = 500) print(mc)data(nrm_example) mc <- nrm_monte_carlo(nrm_example, stat_fn = function(d) mean(d$crop_yield), n_iter = 500) print(mc)
Fits a multivariate Ordinary Least Squares (OLS) regression model and returns standardised diagnostics suitable for Natural Resource Management (NRM) data.
nrm_multivariate(data, formula, scale = TRUE)nrm_multivariate(data, formula, scale = TRUE)
data |
A data frame. |
formula |
A model |
scale |
Logical. If |
A list of class "nrm_multivariate" with components:
modelThe fitted lm object.
coefficientsTidy coefficient table.
r_squaredAdjusted R-squared.
vifVariance inflation factors (requires car).
data(nrm_example) mv <- nrm_multivariate(nrm_example, formula = crop_yield ~ N + P + K + rainfall) nrm_summary(mv)data(nrm_example) mv <- nrm_multivariate(nrm_example, formula = crop_yield ~ N + P + K + rainfall) nrm_summary(mv)
Given a fitted response curve, computes the economically optimal input level based on input cost and output price ratios.
nrm_optimize_input(curve_result, price_ratio = 1)nrm_optimize_input(curve_result, price_ratio = 1)
curve_result |
An object of class |
price_ratio |
Numeric. Ratio of input cost to output price
(e.g. cost per kg N / price per kg grain). Default |
A list of class "nrm_optimize_input" with:
biophysical_optimumInput giving maximum biological yield.
economic_optimumInput giving maximum economic return.
price_ratioThe price ratio used.
data(nrm_example) rc <- nrm_response_curve(nrm_example, input_var = "N", response_var = "crop_yield") opt <- nrm_optimize_input(rc, price_ratio = 0.5) print(opt)data(nrm_example) rc <- nrm_response_curve(nrm_example, input_var = "N", response_var = "crop_yield") opt <- nrm_optimize_input(rc, price_ratio = 0.5) print(opt)
Fits fixed-effects or random-effects panel models using plm, with a Hausman test to guide model selection between fixed and random effects.
nrm_panel(data, formula, index, model = "within")nrm_panel(data, formula, index, model = "within")
data |
A data frame in long format. |
formula |
A model formula, e.g. |
index |
Character vector of length 2 giving the panel ( |
model |
Character. Panel model type: |
A list of class "nrm_panel" with:
modelThe fitted plm object.
hausmanHausman test result (fixed effects vs random effects).
summaryModel summary.
Croissant, Y., & Millo, G. (2008). Panel data econometrics in R: The plm package. Journal of Statistical Software, 27(2), 1–43. doi:10.18637/jss.v027.i02
set.seed(1) d <- data.frame( site = rep(c("A", "B", "C", "D"), each = 10), year = rep(2010:2019, times = 4), crop_yield = rnorm(40, 4, 0.5), N = rnorm(40, 90, 10), rainfall = rnorm(40, 650, 50) ) pm <- nrm_panel(d, formula = crop_yield ~ N + rainfall, index = c("site", "year"), model = "within") nrm_summary(pm)set.seed(1) d <- data.frame( site = rep(c("A", "B", "C", "D"), each = 10), year = rep(2010:2019, times = 4), crop_yield = rnorm(40, 4, 0.5), N = rnorm(40, 90, 10), rainfall = rnorm(40, 650, 50) ) pm <- nrm_panel(d, formula = crop_yield ~ N + rainfall, index = c("site", "year"), model = "within") nrm_summary(pm)
Produces a ggplot2 visualisation appropriate to the result type.
nrm_plot(x, ...)nrm_plot(x, ...)
x |
An NRMstatsML result object. |
... |
Currently unused. |
A ggplot2 object (invisibly).
Fits a Partial Least Squares (PLS) regression model using
plsr, suitable when predictors are collinear or when
the number of predictors approaches the number of observations.
nrm_pls(data, formula, ncomp = NULL, validation = "CV")nrm_pls(data, formula, ncomp = NULL, validation = "CV")
data |
A data frame. |
formula |
A model formula. |
ncomp |
Integer. Number of PLS components to extract. If |
validation |
Character. Cross-validation method passed to
|
A list of class "nrm_pls" with components:
modelThe fitted plsr object.
ncompNumber of components used.
rmsepRoot Mean Square Error of Prediction (RMSEP) by component.
Wold, S., Sjostrom, M., & Eriksson, L. (2001). PLS-regression: a basic tool of chemometrics. Chemometrics and Intelligent Laboratory Systems, 58, 109–130.
data(nrm_example) pl <- nrm_pls(nrm_example, formula = crop_yield ~ N + P + K + rainfall + soil_OC) nrm_summary(pl)data(nrm_example) pl <- nrm_pls(nrm_example, formula = crop_yield ~ N + P + K + rainfall + soil_OC) nrm_summary(pl)
Fits quadratic or nonlinear response curves relating an input (e.g. fertiliser rate) to a response variable (e.g. crop yield), commonly used in long-term fertiliser trial analysis.
nrm_response_curve( data, input_var, response_var, type = c("quadratic", "linear", "mitscherlich") )nrm_response_curve( data, input_var, response_var, type = c("quadratic", "linear", "mitscherlich") )
data |
A data frame. |
input_var |
Character. Predictor variable name (e.g. |
response_var |
Character. Response variable name (e.g. |
type |
Character. Curve type: |
A list of class "nrm_response_curve" with:
modelThe fitted model object.
typeThe curve type used.
optimumEstimated optimum input level (for quadratic).
r_squaredModel R-squared.
data(nrm_example) rc <- nrm_response_curve(nrm_example, input_var = "N", response_var = "crop_yield", type = "quadratic") nrm_plot(rc)data(nrm_example) rc <- nrm_response_curve(nrm_example, input_var = "N", response_var = "crop_yield", type = "quadratic") nrm_plot(rc)
Fits a Structural Equation Model (SEM) using sem.
Intended for path analysis of interlinked Natural Resource Management (NRM)
processes (e.g. soil organic carbon mediating the effect of fertiliser on
yield).
nrm_sem(data, model, ...)nrm_sem(data, model, ...)
data |
A data frame. |
model |
Character string in lavaan model syntax. |
... |
Additional arguments passed to |
A list of class "nrm_sem" containing:
modelThe fitted lavaan object.
fit_indicesComparative Fit Index (CFI), Tucker-Lewis Index (TLI), Root Mean Square Error of Approximation (RMSEA), and Standardised Root Mean Square Residual (SRMR).
parameter_estimatesStandardised path coefficients.
Rosseel, Y. (2012). lavaan: An R package for structural equation modeling. Journal of Statistical Software, 48(2), 1–36. doi:10.18637/jss.v048.i02
if (requireNamespace("lavaan", quietly = TRUE)) { model_syn <- " crop_yield ~ N + soil_OC soil_OC ~ biomass + N " data(nrm_example) sem_res <- nrm_sem(nrm_example, model = model_syn) nrm_summary(sem_res) }if (requireNamespace("lavaan", quietly = TRUE)) { model_syn <- " crop_yield ~ N + soil_OC soil_OC ~ biomass + N " data(nrm_example) sem_res <- nrm_sem(nrm_example, model = model_syn) nrm_summary(sem_res) }
Computes Sen's slope as a robust, nonparametric estimate of the linear trend magnitude in a time series.
nrm_sens_slope(data, time_var = "year", value_var)nrm_sens_slope(data, time_var = "year", value_var)
data |
A data frame containing at least the columns specified by
|
time_var |
Character. Name of the column holding the time index
(e.g. |
value_var |
Character. Name of the column holding the response variable
(e.g. |
A list of class "nrm_sens_slope" with components:
slopeSen's slope (units of value_var per time step).
interceptEstimated intercept.
conf_int95 % confidence interval for the slope.
rawFull output from sens.slope.
Sen, P. K. (1968). Estimates of the regression coefficient based on Kendall's tau. Journal of the American Statistical Association, 63, 1379–1389.
data(nrm_example) ss <- nrm_sens_slope(nrm_example, time_var = "year", value_var = "crop_yield") print(ss)data(nrm_example) ss <- nrm_sens_slope(nrm_example, time_var = "year", value_var = "crop_yield") print(ss)
Detects structural breakpoints in a time series using the Bai-Perron framework implemented in strucchange.
nrm_structural_break(data, time_var = "year", value_var, max_breaks = 5)nrm_structural_break(data, time_var = "year", value_var, max_breaks = 5)
data |
A data frame containing at least the columns specified by
|
time_var |
Character. Name of the column holding the time index
(e.g. |
value_var |
Character. Name of the column holding the response variable
(e.g. |
max_breaks |
Integer. Maximum number of breaks to test. Default |
A list of class "nrm_structural_break" with components:
n_breaksNumber of detected breaks.
break_datesTime values at which breaks occur (extracted
from time_var).
rawFull breakpoints object.
Bai, J., & Perron, P. (2003). Computation and analysis of multiple structural change models. Journal of Applied Econometrics, 18, 1–22.
data(nrm_example) sb <- nrm_structural_break(nrm_example, time_var = "year", value_var = "crop_yield") print(sb)data(nrm_example) sb <- nrm_structural_break(nrm_example, time_var = "year", value_var = "crop_yield") print(sb)
Prints a concise summary for any NRMstatsML result object.
nrm_summary(object, ...)nrm_summary(object, ...)
object |
An NRMstatsML result object (e.g. |
... |
Currently unused. |
The object invisibly.
Runs Mann-Kendall test, Sen's slope estimator, and optional structural-break detection on a univariate time series extracted from a data frame.
nrm_trend(data, time_var = "year", value_var, breaks = TRUE, alpha = 0.05)nrm_trend(data, time_var = "year", value_var, breaks = TRUE, alpha = 0.05)
data |
A data frame containing at least the columns specified by
|
time_var |
Character. Name of the column holding the time index
(e.g. |
value_var |
Character. Name of the column holding the response variable
(e.g. |
breaks |
Logical. If |
alpha |
Numeric. Significance level for the Mann-Kendall test.
Default |
A list of class "nrm_trend" with components:
mann_kendallOutput of nrm_mann_kendall.
sens_slopeOutput of nrm_sens_slope.
structural_breaksOutput of nrm_structural_break
or NULL when breaks = FALSE.
dataThe data argument, for downstream use.
callThe matched call.
nrm_mann_kendall, nrm_sens_slope,
nrm_structural_break
data(nrm_example) result <- nrm_trend(nrm_example, time_var = "year", value_var = "crop_yield") print(result) nrm_plot(result)data(nrm_example) result <- nrm_trend(nrm_example, time_var = "year", value_var = "crop_yield") print(result) nrm_plot(result)
Runs bootstrap resampling or Monte Carlo simulation to quantify uncertainty around a statistic of interest computed on NRM data.
nrm_uncertainty( data, stat_fn, method = "bootstrap", n_iter = 1000L, alpha = 0.05, ... )nrm_uncertainty( data, stat_fn, method = "bootstrap", n_iter = 1000L, alpha = 0.05, ... )
data |
A data frame. |
stat_fn |
A function that takes a data frame and returns a single
numeric value (or named numeric vector). Must accept a |
method |
Character. |
n_iter |
Integer. Number of resamples / simulations. Default |
alpha |
Numeric. Significance level for confidence intervals. Default |
... |
Additional arguments passed to |
A list of class "nrm_uncertainty" with:
meanMean of the resampled statistic.
ciConfidence interval at 1 - alpha level.
sdStandard deviation of the resampled statistic.
methodMethod used.
data(nrm_example) unc <- nrm_uncertainty(nrm_example, stat_fn = function(d) mean(d$crop_yield), method = "bootstrap", n_iter = 500) print(unc)data(nrm_example) unc <- nrm_uncertainty(nrm_example, stat_fn = function(d) mean(d$crop_yield), method = "bootstrap", n_iter = 500) print(unc)