Internal function to analyze data and compute quality metrics for encoding.
This function is used both by bf_analyze for user-facing analysis and by
bf_map to store quality metrics in the provenance.
.assessEncodingQuality(
values,
type,
enc = NULL,
isRaster = FALSE,
rasterLevels = NULL,
range = NULL,
decimals = NULL,
max_bits = 16L,
fields = NULL,
errorOnAllNA = FALSE
)list of quality metrics appropriate for the encoding type. For float without specific enc, returns a list with data summary and results data.frame.
vector of values to assess (will be cleaned of NAs internally)
encoding type ("bool", "enum", "int", "float")
list with encoding parameters (sign, exponent, significand, bias). If NULL (for bf_analyze), type-appropriate defaults or multiple configs are tested.
logical, whether data comes from a SpatRaster (enum only)
data.frame with raster attribute table (enum only)
optional target range c(min, max) for float analysis
optional decimal precision for float comparison
maximum total bits to consider (default 16)
optional list specifying which exp/sig configurations to analyze (float only)