Returns the metadata attributes attached to results from analog_search(),
or any analog_*() wrapper function that calls it, as a named list. These
same values can be accessed individually via attr(x, "<name>");
metadata() is a convenience that bundles them into a consistent
list structure independent of the underlying attribute layout.
Use it to inspect or programmatically reconstruct the parameterization
that produced a result. Each attribute records one user-facing parameter
or input-data property.
Value
A named list. Elements depend on which attributes are present on
x; missing attributes are simply absent from the returned list (no
NA placeholders). Possible elements include:
Selection and aggregation parameters
selectSelection strategy:
"all","knn_clim", or"knn_geog".kNumber of neighbors for kNN selection modes;
NULLforselect = "all".statAggregation statistic(s) requested. Character vector;
"none"for pair-mode results.kernelKernel function used for analog weighting (e.g.
"gaussian_clim"), orNULLif no weighted aggregation was requested.thetaKernel bandwidth or epsilon parameter; scalar for most kernels, length-2 numeric for
*_jointkernels.lambdaRidge penalty for
stat = "regression";0for ordinary weighted least squares.seStandard-error framing applied to SE-supporting stats:
"none","ess", or"design".max_climClimate-distance threshold used for analog selection. Scalar for Euclidean / Mahalanobis radius, or length-
n_climfor per-variable thresholds.max_geogGeographic-distance threshold used for analog selection. Units are km when
coord_type = "lonlat", projection units otherwise.exclude_selfLogical: was each focal's own pool row excluded from its analog neighborhood?
TRUEfor results fromanalog_cv()(LOO) or fromanalog_search(exclude_self = TRUE).
Input-data properties
n_xNumber of focal locations in the input
x.n_poolNumber of reference locations in the input
pool.n_climNumber of climate variables.
coord_typeCoordinate system:
"lonlat"(great-circle distances in km) or"projected"(planar distances in projection units).x_cov_providedLogical: was a per-focal covariance matrix (
x_cov) supplied? IfTRUE, climate distances were computed in Mahalanobis units using location-specific covariance; otherwise Euclidean.downsample_actualActual downsampling rate applied to the reference pool (1.0 if no downsampling). May exceed the requested rate when maintaining at least one point per occupied bin requires it.
Index diagnostics (lattice-related)
These attributes describe the internal lattice index used to
accelerate the search; they're useful for performance debugging but
not needed to reproduce the result. See build_analog_index() for
detail.
binning_methodInternal indexing method; one of
"lattice"or"lattice_ecef".total_bins,n_bins_nonempty,min_bin_occupancy,max_bin_occupancy,avg_bin_occupancy,avg_nonempty_bin_occupancyLattice occupancy summaries.
Cross-validation metadata
Present only when x is a result from analog_cv().
cv_method"loo"or"kfold".cv_funName of the analog function being cross-validated (e.g.
"analog_impact").cv_n_foldsNumber of folds (k-fold only).
cv_pred_targetMechanism used to extract predictions for residuals:
"weighted_mean","regression", or"none".
Details
metadata() is the documented entry point for reading these
attributes; the attribute names themselves are also part of the public
contract, so attr(x, "select") etc. are equally valid for individual
values. The function's main advantages over raw attributes() are: it
filters out R-internal attributes (names, class, dim, ...), and
the ?metadata help page gives a single canonical reference for
every attribute the package attaches.
Examples
if (FALSE) { # \dontrun{
result <- analog_velocity(
x = future_climate,
pool = current_climate,
max_clim = 0.5
)
# Get the full parameterization as a list
meta <- metadata(result)
meta$select
meta$max_clim
meta$n_pool
# Or read individual attributes directly
attr(result, "select")
} # }