Skip to content

feat: implement silv_density_sdimax and add sdimax_models dataset#25

Open
aitorvv wants to merge 2 commits into
mainfrom
avv-sdimax-rodriguez-prado
Open

feat: implement silv_density_sdimax and add sdimax_models dataset#25
aitorvv wants to merge 2 commits into
mainfrom
avv-sdimax-rodriguez-prado

Conversation

@aitorvv

@aitorvv aitorvv commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR implements the calculation of the Maximum Stand Density Index (SDImax) based on the models from Rodríguez de Prado (2020).
It adds the sdimax_models dataset containing the reference ("basic") and climate-dependent parameters, and introduces the new silv_density_sdimax() function.

Verification

# Inspect new dataset
devtools::load_all()
str(sdimax_models)   # 88 rows x 13 columns
dplyr::count(sdimax_models, model_name)  # basic: 15, and other climate-dependent models

# Verify new function - Reference (basic) model calculation
# Expected value for Pinus sylvestris: ~1114.77
sdimax_ref <- silv_density_sdimax("Pinus sylvestris")
print(sdimax_ref)

# Verify new function - Climate-dependent model calculation
# Expected value for Pinus canariensis (P1 at 400): ~103600.4
sdimax_clim <- silv_density_sdimax("Pinus canariensis", climatic_model = "P1", clim_value = 400)
print(sdimax_clim)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants