View source: R/check_monthly_radiations.R
| check_monthly_radiations | R Documentation |
Checks that a monthly radiation data.frame is correctly formatted and physically valid for use by the light interception and ray-tracing model. The table must contain exactly 12 months of radiation data.
check_monthly_radiations(x, verbose = TRUE)
x |
A data.frame with monthly radiation values, typically produced by
|
verbose |
Logical; if |
The input must contain the following columns:
Integer month number (1-12)
Monthly global horizontal irradiation (MJ/m2)
Diffuse-to-global radiation ratio (unitless, 0-1)
The function checks:
The object is a data.frame.
Required columns are present.
There are exactly 12 months.
Each month (1-12) is present exactly once.
Data are numeric and finite.
Hrad strictly positive.
DGratio between 0 and 1.
Months are in increasing order.
Invisibly returns TRUE if all checks pass.
# Using the example dataset from the package
data_prenovel <- SamsaRaLight::data_prenovel
radiations <- data_prenovel$radiations
# Check the inventory
check_monthly_radiations(radiations)
# Quiet mode
check_monthly_radiations(radiations, verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.