Title: Modeling the Relationship Between Nematode Densities and Plant Growth
Version: 1.0.1
Description: Implements the Seinhorst model to analyze the relationship between initial nematode densities and plant growth response using nonlinear least squares estimation. The package provides tools for model fitting, prediction, and visualization, facilitating the study of plant-nematode interactions. Model parameters can be estimated or set to predefined values based on Seinhorst (1986) <doi:10.1007/978-1-4613-2251-1_11>.
License: GPL (≥ 3)
Encoding: UTF-8
RoxygenNote: 7.3.2
Imports: minpack.lm
Suggests: testthat (≥ 3.0.0), readxl, knitr, rmarkdown
Config/testthat/edition: 3
URL: https://github.com/dslabcena/seinfitR
BugReports: https://github.com/dslabcena/seinfitR/issues
Depends: R (≥ 3.5)
LazyData: true
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2025-04-08 20:12:35 UTC; joaon
Author: Deoclecio Amorim [aut] (cph), João Novoletti [aut, cre, cph]
Maintainer: João Novoletti <joao.novoletti@gmail.com>
Repository: CRAN
Date/Publication: 2025-04-09 10:10:02 UTC

Extract Coefficients

Description

Extract model coefficients from a seinfitR object.

Usage

## S3 method for class 'seinfitR'
coef(object, ...)

Arguments

object

Object of class 'seinfitR'.

...

currently unused.

Value

A named numeric vector containing the estimated model coefficients.


Glasshouse Experiment Dataset

Description

This dataset originates from a greenhouse experiment that assessed the effect of nematode population density on plant yield. One cultivar was used, and 14 different nematode population densities (p_i), including zero, were tested. Each density was replicated five times. The dataset provides the nematode densities and the corresponding average plant yield.

Usage

data(glasshouse, package = "seinfitR")

Format

A data frame with 14 rows and 2 columns:

p_i

Nematode population density (initial population).

y

Average crop yield at the given population density.

References

Schomaker, C., & Been, T. (2013). Plant growth and population dynamics. Plant Nematology, 301-330. doi:10.1079/9781780641515.0301


Jambu Dataset

Description

This dataset is based on the results of a pre-modeled raw dataset. The original data was generated using seven repetitions for five initial nematode population densities (p_i): 0, 500, 1000, 2500, and 5000. The model parameters t, m, and z obtained from the raw dataset were then used to predict and extend p_i values across the range from 0 to 5001.

Usage

data(jambu, package = "seinfitR")

Format

A data frame with 5,002 rows and 2 columns:

p_i

Nematode population density (initial population).

y

Crop yield, another plant growth parameter, or the ratio of the estimated variable for plant growth at an initial nematode population density.

Details

This dataset is used in the seinfitR package to study the relationship between nematode populations and plant growth.

Source

https://osf.io/pm94t

References

Silva, M.F., Faccioli, F.C., Honório, A.P. et al. (2024). First report of angular leaf spot in Acmella oleracea caused by the foliar nematode Aphelenchoides pseudobesseyi. J Plant Dis Prot, 131, 1707–1720. doi:10.1007/s41348-024-00982-2


Plot SeinfitR

Description

Plot method for seinfitR objects

Usage

## S3 method for class 'seinfitR'
plot(x, rel = FALSE, ...)

Arguments

x

An object of class seinfitR (output from seinfitR()).

rel

Logical. If TRUE, the observed and fitted values are plotted relative to the maximum fitted value (normalized between 0 and 1). If FALSE, the original observed and fitted values are plotted.

...

currently unused.

Value

A plot showing the observed data (blue points) and the fitted curve (red line).


Predict SeinfitR

Description

Predict method for seinfitR objects

Usage

## S3 method for class 'seinfitR'
predict(object, newdata = NULL, ...)

Arguments

object

An object of class seinfitR (output from seinfitR()).

newdata

Optional. A data frame containing the independent variable for which predictions should be made. If not provided, predictions are made for the original data.

...

currently unused.

Details

This function generates predictions based on a fitted Seinhorst model.

Value

A data frame with the independent variable and the corresponding predicted values.


Print SeinfitR

Description

Print contents of seinfitR object.

Usage

## S3 method for class 'seinfitR'
print(x, digits = max(3L, getOption("digits") - 3L), ...)

Arguments

x

Object of class 'seinfitR'.

digits

minimal number of significant digits

...

currently unused.

Value

No return value, called for side effects

See Also

seinfitR


R-squared Calculation

Description

Compute R-squared for seinfitR model.

Usage

r_squared(object, ...)

Arguments

object

Object of class 'seinfitR'.

...

currently unused.

Value

A list with the following components:

R2

The coefficient of determination (R-squared).

Adjusted_R2

The adjusted R-squared value.


SeinfitR

Description

This function fits the Seinhorst equation to experimental data describing the relationship between preplant nematode densities and plant growth using nonlinear least squares fitting. The fitting process is performed using the nlsLM function from the minpack.lm package.

Usage

seinfitR(p_i, y, data, start, z_fixed = FALSE, control = seinfitR_control())

Arguments

p_i

A character string specifying the column name in data that contains preplant nematode densities.

y

A character string specifying the column name in data that contains the plant growth response.

data

A data frame containing the experimental data. It must include at least two columns: one representing the preplant nematode densities (p_i) and another representing the plant growth response (y).

start

A list of initial parameter values for m, t, and z (if z_fixed = FALSE). These values are used to initialize the nonlinear least squares fitting process.

z_fixed

Logical. If TRUE, the function uses the default value for \( z^t \), as described in Seinhorst (1986) doi:10.1007/978-1-4613-2251-1_11

control

A control object created using seinfitR_control(), which specifies options for the optimization process.

Value

A list of class "seinfitR" containing:

fit

An object of class nls with the fitted model.

summary_seinfitR

Summary statistics of the fitted model.

cov

The covariance matrix of parameter estimates (if available).

data

The original dataset used for fitting.

x

The name of the predictor variable used (p_i).

y

The name of the response variable used (y).

z_fixed

Logical value indicating whether z was fixed.

Examples

# Example: Modeling plant response to nematode densities using "jambu" dataset

# Fit the model using seinfitR with specified initial values
model <- seinfitR(p_i = "p_i", y = "y", data = jambu,
                  start = list(m = 0.103, t = 250, z = 0.991),
                  control = seinfitR_control(maxiter = 5))

# View model summary
summary(model)

SeinfitR Control

Description

Custom Control Function for the SeinfitR Model Fitting

Usage

seinfitR_control(
  ftol = sqrt(.Machine$double.eps),
  ptol = sqrt(.Machine$double.eps),
  gtol = 0,
  diag = list(),
  epsfcn = 0,
  factor = 100,
  maxfev = integer(),
  maxiter = 50,
  nprint = 0,
  trace = FALSE
)

Arguments

ftol

Termination condition for relative reduction in the sum of squares.

ptol

Termination based on relative error between two consecutive iterations.

gtol

Controls the orthogonality between the function vector and the Jacobian.

diag

Multiplicative scale factors for the parameters.

epsfcn

Step size for forward-difference approximation of the Jacobian.

factor

Initial step bound factor.

maxfev

Maximum number of function evaluations.

maxiter

Maximum number of iterations.

nprint

Controls printing of iteration details.

trace

A logical value indicating if a trace of the iteration progress should be printed.

Details

This function returns a list of control parameters for the Levenberg-Marquardt algorithm used by the nlsLM function from the minpack.lm package. These parameters are specifically designed to control the fitting process in the seinfitR function.

Value

A list of control parameters to be used in the nlsLM function during the fitting of the Seinhorst model using seinfitR.


Summary of seinfitR Model

Description

Display a summary of the seinfitR model.

Usage

## S3 method for class 'seinfitR'
summary(object, ...)

Arguments

object

Object of class 'seinfitR'.

...

currently unused.

Value

No return value, called for side effects.

See Also

seinfitR


Variance-Covariance Matrix

Description

Compute variance-covariance matrix for seinfitR model.

Usage

## S3 method for class 'seinfitR'
vcov(object, ...)

Arguments

object

Object of class 'seinfitR'.

...

currently unused.

Value

A matrix representing the covariance of the estimated coefficients.