Major overhaul of the species coding system.
level column
(0 = finest leaf, higher numbers = coarser groups). bavrn_state and
tum_wwk_long are now hierarchical.99 ("Strauch", shrub). Whether a
code is a tree code is derived from its link to the
species_master_table, so there is no separate flag to keep in sync. New
exported helpers fe_species_is_tree() and fe_species_non_tree_codes()
report this.
fe_stand() and its spatial children now reject non-tree species codes
with a clear error.NA (with a message)
instead of raising an error.species_cast_overrides, declares deliberate target codes for
otherwise forward-ambiguous casts.master_template_csv(), master_table_from_csv(),
coding_template_from_master(), coding_table_from_template(), and
cast_overrides_from_csv(). Coding tables are now stored in a canonical row
order (level, then code, then master key), and the builder rejects
inconsistent or conflicting entries early.tum_wwk_long filled out with grouping levels and now covering all master
species, and additional master species (e.g. the genera Cedrus and
Corylus).bavrn_state -> tum_wwk_short: the oak group
code 70 ("Eiche (Gruppe)") now resolves to 6 (oak), and the
"other hardwood" code 80 ("Sonstige Laubhölzer") to 8 (other hardwood).
Both casts were forward-ambiguous (70 straddles {6, 8} via red oak, 80
straddles {8, 9} hard/soft broadleaf) and therefore errored. This unblocks
downstream casting of BaySF inventory data carrying these group codes.fe_species_get_field_table() returns a compact,
field-usable lookup table for a coding: each code exactly once, with the
coding's own species/group names (all three languages), plus the level
and is_tree columns, in canonical order. Rendering it into a printable
document is left to downstream packages.level column, non-tree codes and
is_tree, the finest-node cast and the cast-override mechanism, the cast
information-loss message (formerly a warning), the new field table, and a
rewritten "Information for developers" part documenting the CSV-driven
builder workflow.Other news
has_required_names,
has_required_types_or_classes, has_no_missing_values, and is_distinct
(previously internal). They remain marked with @keywords internal, but are
now part of the public interface so that dependent packages (e.g. FeNEU)
can call them with :: instead of relying on the non-exported :::
mechanism, which is not permitted on CRAN.wood_density_tum_wwk_short from an internal object (in
sysdata.rda) to a documented, exported dataset. It is now accessible as
ForestElementsR::wood_density_tum_wwk_short.ytable_age_slice, ytable_max_slice,
site_index, ytable_lookup, si_to_mai_age, si_to_mai_max, and
stocking_level were made more safe. These functions are not designed for
working with input variable vectors of length > 1. However, under certain
circumstances such input would trigger a warning, but produce dubious results.
Now, any attempt to provide input vectors with more than one element to these
functions results in an error.Revised CRAN submission
We have addressed the issues raised by Konstanze Lauseker in her review of the initial submission:
DESCRIPTION file.::: even in internal documentation.\dontrun{} with try() for examples that intentionally generate
errors.options(warn = -1) with suppressWarnings() in the automated
tests.Initial CRAN submission.