MyNixOS website logo
Description

Leaf Area Modeling, Evaluation, and Prediction.

Tools for leaf area estimation based on leaf length, leaf width, and observed leaf area. The package supports data validation, predictor generation, descriptive statistics, exploratory graphics, scatterplot matrices, linear models, nonlinear models, mixed models, model evaluation, ranking, equation generation, prediction, export of results and plots, and an interactive 'shiny' application. Methods implemented in the package are aligned with non-destructive allometric workflows described by Ribeiro et al. (2024) <doi:10.1016/j.sajb.2024.07.006>, Ribeiro et al. (2023) <doi:10.1590/1807-1929/agriambi.v27n3p209-215>, and Ribeiro et al. (2025) <doi:10.1590/0103-8478cr20230550>.

leafareaR

leafareaR

leafareaR is an R package for leaf area modeling, evaluation, prediction, and visualization based on leaf length (L), leaf width (W), and observed leaf area (LA).

The package supports:

  • input validation
  • predictor generation
  • descriptive statistics
  • linear, nonlinear, and mixed models
  • model evaluation and ranking
  • equation extraction
  • prediction
  • exploratory graphics
  • an interactive Shiny application

Installation

During development:

devtools::load_all(".")

Typical workflow

A typical workflow in leafareaR involves:

  1. validating the input data;
  2. generating derived predictors from L and W;
  3. fitting candidate models;
  4. evaluating and ranking the fitted models;
  5. extracting equations and coefficients;
  6. generating predictions and graphics.

Example dataset

The package includes a sample dataset named leafarea_sample.

data("leafarea_sample", package = "leafareaR")
leafarea_sample[1:6, c("L", "W", "LA")]

Optional grouping variables such as block, species, and genotype may also be present in the example dataset.

Input validation

dat <- la_validate_input(leafarea_sample)

Predictor generation

dat2 <- la_create_derived(
  dat,
  variables = c("LW", "L2", "W2", "L3", "W3", "L_plus_W")
)

Linear models

fit_linear <- la_fit_linear_models(dat2)
length(fit_linear$models)

Model evaluation and ranking

met_linear <- la_evaluate_linear_models(fit_linear)
ranked_linear <- la_rank_models(met_linear)
la_top_models(ranked_linear, n = 5)

Equations

best_linear <- fit_linear$models[[ranked_linear$model_id[1]]]
la_build_equation(best_linear)

Prediction

pred <- la_predict_top_ranked(
  ranked_table = ranked_linear,
  fit_object = fit_linear,
  rank_position = 1,
  newdata = dat2[1:10, ]
)

pred[1:6, c("LA", "LA_pred", "residual")]

Graphics

Scatter plot

la_plot_scatter(dat2, x = "LW", y = "LA")

Observed versus predicted

vals <- la_linear_fitted_values(fit_linear, ranked_linear$model_id[1])

la_plot_observed_predicted(
  observed = vals$observed,
  predicted = vals$fitted,
  model_name = ranked_linear$model_id[1]
)

Nonlinear and mixed models

The same general workflow can be applied to nonlinear and mixed models.

# Nonlinear example
fit_nonlinear <- la_fit_nonlinear_models(dat2, models = c("power_LW"))

# Mixed example
fit_mixed <- la_fit_mixed_models(dat2, group_var = "species")

Shiny application

leafareaR also provides an interactive Shiny application.

run_leafareaR_app()

With the app, users can:

  • load the built-in example dataset (leafarea_sample) with one click;
  • upload a dataset;
  • select predictors for modeling;
  • choose model families and model types;
  • fit and compare candidate models;
  • inspect equations and coefficients;
  • export ranked results and graphics.

Summary

leafareaR provides a practical workflow for leaf area analysis, from data validation to model comparison, equation reporting, prediction, and visualization.

The package can be used in scripted analyses as well as through its Shiny interface.

Metadata

Version

0.0.1

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows