| Type: | Package |
| Title: | Nitrogen Use Efficiency Toolkit on Numerics |
| Version: | 0.2.0 |
| Description: | A comprehensive toolkit for calculating and visualizing Nitrogen Use Efficiency (NUE) indicators in agricultural research. The package implements 23 parameters categorized into fertilizer-based, plant-based, soil-based, isotope-based, ecology-based, and system-based indicators based on Congreves et al. (2021) <doi:10.3389/fpls.2021.637108>. Key features include vectorized calculations for paired-plot experimental designs, batch processing capabilities for handling large datasets, and built-in visualization tools using 'ggplot2'. Designed to streamline the workflow from raw agronomic data to publication-ready metrics and plots. |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| Imports: | dplyr, ggplot2, magrittr, rlang |
| RoxygenNote: | 7.3.3 |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2025-12-17 09:21:04 UTC; shubhamlove |
| Author: | Shubham Love [aut, cre] |
| Maintainer: | Shubham Love <shubhamlove2101@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2025-12-17 23:20:23 UTC |
NUETON: Nitrogen Use Efficiency Toolkit on Numerics
Description
The NUETON package provides a comprehensive suite of tools for calculating
Nitrogen Use Efficiency (NUE) indicators from agricultural experimental data.
It includes vector-based calculations for 23 different parameters, batch processing
capabilities, and automated visualization tools.
Getting Started
The quickest way to learn the package is to run the included demo script, which demonstrates the batch processing and visualization features on a built-in dataset.
# Run the master walkthrough
demo("nueton_walkthrough", package = "NUETON")
Key Functions
-
calculate_nue_batch: Automatically calculates all 23 indicators from a dataframe. -
plot_nue_compare: Visualizes the results with error bars.
Author(s)
Maintainer: Shubham Love shubhamlove2101@gmail.com
Calculate Agronomic Efficiency (AE)
Description
The contribution of fertilizer N towards yield, compared to a non-fertilized control. Formula: AE = (YieldF - Yield0) / FertN
Usage
AE(YieldF, Yield0, FertN)
Arguments
YieldF |
A numeric vector for yield in fertilized conditions. |
Yield0 |
A numeric vector of non-fertilized control yield values. |
FertN |
A numeric value or vector for fertilizer N input. |
Value
A numeric vector of AE values.
Examples
YieldF <- c(10, 12, 15)
Yield0 <- c(5, 5, 5)
FertN <- 50
AE(YieldF, Yield0, FertN)
Calculate Internal Efficiency (IE)
Description
The fraction of plant tissue N that is contained in the yield component. Formula: IE = YieldNF / PlantNf
Usage
IE(YieldNF, PlantNf)
Arguments
YieldNF |
A numeric vector for yield N in fertilized conditions. |
PlantNf |
A numeric vector for plant N in fertilized conditions. |
Value
A numeric vector of IE values.
Examples
YieldNF <- c(80, 90, 100)
PlantNf <- c(3.5, 4.0, 4.2)
IE(YieldNF, PlantNf)
Calculate N Balance Intensity (NBI)
Description
The difference between fertilizer N applied and the N removed as yield (N Surplus). Formula: NBI = FertN - YieldN
Usage
NBI(YieldN, FertN)
Arguments
YieldN |
A numeric vector of the N removed as yield. |
FertN |
A numeric value or vector for fertilizer N input. |
Value
A numeric vector of NBI values.
Examples
YieldN <- c(80, 90, 100)
FertN <- 50
NBI(YieldN, FertN)
Calculate N Harvest Index (NHI)
Description
The percent of plant tissue N that is contained in the yield component. Formula: NHI = YieldF / PlantNf
Usage
NHI(YieldF, PlantNf)
Arguments
YieldF |
A numeric vector of final yield values. |
PlantNf |
A numeric vector for total plant tissue N. |
Value
A numeric vector of NHI values.
Examples
YieldF <- c(10, 12, 15)
PlantNf <- c(2.5, 3.0, 3.2)
NHI(YieldF, PlantNf)
Calculate Nitrogen Productivity (NP)
Description
The ratio of the relative growth rate to the concentration of N in plant tissues. Formula: NP = GR / PlantN
Usage
NP(GR, PlantN)
Arguments
GR |
A numeric vector for Plant relative growth rate. |
PlantN |
A numeric vector for plant N concentration. |
Value
A numeric vector of NP values.
Examples
GR <- c(0.5, 0.6)
PlantN <- c(2.0, 2.2)
NP(GR, PlantN)
Calculate Fertilizer N Recovery Efficiency (NRE)
Description
The percentage of fertilizer N that is taken up by the plant. Formula: NRE = ((PlantNf - PlantN0) / FertN) * 100
Usage
NRE(PlantNf, PlantN0, FertN)
Arguments
PlantNf |
A numeric vector of plant N in fertilized conditions. |
PlantN0 |
A numeric vector of plant N in control conditions. |
FertN |
A numeric value or vector for fertilizer N input. |
Value
A numeric vector of NRE percentages.
Examples
PlantNf <- c(3.5, 4.0, 4.2)
PlantN0 <- c(2.0, 2.0, 2.0)
FertN <- 50
NRE(PlantNf, PlantN0, FertN)
Calculate Isotope-Based Recovery Efficiency (NRE15)
Description
The percent recovery of fertilizer-N in plant and/or soil components. Formula: NRE15 = (TNdfF / FertN) * 100
Usage
NRE15(TNdfF, FertN)
Arguments
TNdfF |
Total N derived from Fertilizer (vector). |
FertN |
Fertilizer N input (numeric vector or single value). |
Value
A numeric vector of NRE15 percentages.
Examples
TNdfF <- c(5.5, 6.0, 4.8)
FertN <- 50
NRE15(TNdfF, FertN)
Calculate NUE of a Food Chain (NUEFC)
Description
The N balance of the entire food chain system. Formula: NUEFC = Ncon / Ni
Usage
NUEFC(Ncon, Ni)
Arguments
Ncon |
The value of N available for consumption. |
Ni |
Sum total of new N input. |
Value
A numeric vector of NUEFC values.
Examples
Ncon <- c(40, 45)
Ni <- c(100, 110)
NUEFC(Ncon, Ni)
Calculate NUE Balance
Description
The fraction of N inputs that are removed from the system. Formula: NUEbal = No / Ni
Usage
NUEbal(No, Ni)
Arguments
No |
Sum total of N outputs. |
Ni |
Sum total of N inputs. |
Value
A numeric vector of NUEbal values.
Examples
No <- c(50, 60)
Ni <- c(100, 110)
NUEbal(No, Ni)
Calculate NUE Crop
Description
The fraction of fertilizer N that is utilized and allocated to yield N. Formula: NUEcrop = YieldN / FertN
Usage
NUEcrop(YieldN, FertN)
Arguments
YieldN |
A numeric vector of the N removed as yield. |
FertN |
A numeric value or vector for fertilizer N input. |
Value
A numeric vector of NUEcrop values.
Examples
YieldN <- c(80, 90, 100)
FertN <- 50
NUEcrop(YieldN, FertN)
Calculate NUE Soil
Description
The biomass production per unit of available N. Formula: NUEsoil = PlantBM / (FertN + SoilN)
Usage
NUEsoil(PlantBM, SoilN, FertN)
Arguments
PlantBM |
A numeric vector of plant biomass. |
SoilN |
A numeric value or vector for soil N content. |
FertN |
A numeric value or vector for fertilizer N input. |
Value
A numeric vector of NUEsoil values.
Examples
PlantBM <- c(100, 120, 130)
SoilN <- c(20, 20, 20)
FertN <- 50
NUEsoil(PlantBM, SoilN, FertN)
Calculate NUE Yield
Description
The contribution of N supplied from the soil that is allocated to yield. Formula: NUEyield = NUpE * NUtE
Usage
NUEyield(NUpE, NUtE)
Arguments
NUpE |
N Uptake Efficiency value or vector. |
NUtE |
N Utilization Efficiency value or vector. |
Value
A numeric vector of NUEyield values.
Examples
NUpE <- c(40, 50)
NUtE <- c(20, 25)
NUEyield(NUpE, NUtE)
Calculate N Uptake Efficiency (NUpE)
Description
The percentage of available soil N that is utilized by the plant. Formula: NUpE = (PlantN / (FertN + SoilN)) * 100
Usage
NUpE(PlantN, SoilN, FertN)
Arguments
PlantN |
A numeric vector of values for plant N content. |
SoilN |
A numeric value or vector for soil N content. |
FertN |
A numeric value or vector for fertilizer N input. |
Value
A numeric vector of NUpE percentages.
Examples
PlantN <- c(3.0, 3.5, 3.8)
SoilN <- c(20, 20, 20)
FertN <- 50
NUpE(PlantN, SoilN, FertN)
Calculate N Utilization Efficiency (NUtE)
Description
The contribution of fertilizer N from the plant tissues towards the yield component. Formula: NUtE = Yield / PlantN
Usage
NUtE(Yield, PlantN)
Arguments
Yield |
A numeric vector of yield values. |
PlantN |
A numeric vector for plant tissue N. |
Value
A numeric vector of NUtE values.
Examples
Yield <- c(10, 12, 15)
PlantN <- c(2.5, 3.0, 3.2)
NUtE(Yield, PlantN)
Calculate N derived from Fertilizer (NdfF)
Description
The percentage of plant or soil N that is derived from the fertilizer. Formula: NdfF = (Plant15N / Fert15N) * 100
Usage
NdfF(Plant15N, Fert15N)
Arguments
Plant15N |
A vector of 15N atom percent excess in plant or soil. |
Fert15N |
15N atom percent excess of fertilizer N. |
Value
A numeric vector of NdfF percentages.
Examples
Plant15N <- c(0.4, 0.5)
Fert15N <- 2.5
NdfF(Plant15N, Fert15N)
Calculate Physiological Efficiency (PE)
Description
The contribution of fertilizer N from the plant tissues towards the yield component. Formula: PE = (YieldF - Yield0) / (PlantNf - PlantN0)
Usage
PE(YieldF, Yield0, PlantNf, PlantN0)
Arguments
YieldF |
A numeric vector of final yield values. |
Yield0 |
A numeric vector of non-fertilized control yield values. |
PlantNf |
A numeric vector of plant N at the end of the experiment. |
PlantN0 |
A numeric vector of plant N at the beginning/control. |
Value
A numeric vector of PE values.
Examples
YieldF <- c(12, 13, 14)
Yield0 <- c(10, 10, 10)
PlantNf <- c(3.5, 4.0, 4.2)
PlantN0 <- c(2.0, 2.0, 2.0)
PE(YieldF, Yield0, PlantNf, PlantN0)
Calculate Partial Factor Productivity (PFP)
Description
The expression of yield per unit of fertilizer N applied. Formula: PFP = YieldF / FertN
Usage
PFP(YieldF, FertN)
Arguments
YieldF |
A numeric vector of final yield values. |
FertN |
A numeric value or vector for fertilizer N input. |
Value
A numeric vector of PFP values.
Examples
YieldF <- c(10, 12, 15)
FertN <- 50
PFP(YieldF, FertN)
Calculate Partial N Balance (PNB)
Description
The expression of plant N content per unit of fertilizer N applied. Formula: PNB = PlantNf / FertN
Usage
PNB(PlantNf, FertN)
Arguments
PlantNf |
A numeric vector of Plant N content in fertilized conditions. |
FertN |
A numeric value or vector for fertilizer N input. |
Value
A numeric vector of PNB values.
Examples
PlantNf <- c(3.5, 4.0, 4.2)
FertN <- 50
PNB(PlantNf, FertN)
Calculate Total N derived from Fertilizer (TNdfF)
Description
The total quantity of plant or soil N that is derived from fertilizer. Formula: TNdfF = (NdfF/100) * (PlantN or SoilN)
Usage
TNdfF(NdfF, PlantN = NULL, SoilN = NULL)
Arguments
NdfF |
N derived from Fertilizer expressed as a percentage (0-100). |
PlantN |
Optional numeric vector for plant N content. |
SoilN |
Optional numeric vector for soil N content. |
Value
A numeric vector of TNdfF values.
Examples
NdfF <- c(15, 20)
PlantN <- c(3.0, 3.5)
# Case 1: Using Plant N
TNdfF(NdfF, PlantN = PlantN)
# Case 2: Using Soil N (must specify SoilN explicitly)
SoilN <- c(100, 120)
TNdfF(NdfF, SoilN = SoilN)
Calculate Virtual N Factor (VNF)
Description
The portion of N released to the environment not contained in food. Formula: VNF = Nrec / Ncon
Usage
VNF(Nrec, Ncon)
Arguments
Nrec |
N used to produce food item that ends up recycled. |
Ncon |
N in food item that is consumed. |
Value
A numeric vector of VNF values.
Examples
Nrec <- c(10, 12)
Ncon <- c(40, 45)
VNF(Nrec, Ncon)
Calculate All NUE Indicators (Batch Processing)
Description
Automatically detects available data columns and calculates all 23 NUE indicators.
Usage
calculate_nue_batch(
data,
yield_f = "YieldF",
yield_0 = "Yield0",
fert_n = "FertN",
plant_n_f = "PlantNf",
plant_n_0 = "PlantN0",
yield_n = "YieldN",
soil_n = "SoilN",
plant_bm = "PlantBM",
plant_15n = "Plant15N",
fert_15n = "Fert15N",
gr = "GR",
n_con = "Ncon",
n_rec = "Nrec",
n_loss = "Nloss",
n_in = "Ni",
n_out = "No",
delta_soil_n = "delSoilN",
mrt = "MRT"
)
Arguments
data |
A dataframe containing experimental data. |
yield_f |
Column name for Fertilized Yield. Default: "YieldF" |
yield_0 |
Column name for Control Yield. Default: "Yield0" |
fert_n |
Column name for Fertilizer N input. Default: "FertN" |
plant_n_f |
Column name for Plant N (fertilized). Default: "PlantNf" |
plant_n_0 |
Column name for Plant N (control). Default: "PlantN0" |
yield_n |
Column name for N removed as yield. Default: "YieldN" |
soil_n |
Column name for Soil N. Default: "SoilN" |
plant_bm |
Column name for Plant Biomass. Default: "PlantBM" |
plant_15n |
Column name for Plant 15N excess. Default: "Plant15N" |
fert_15n |
Column name for Fertilizer 15N excess. Default: "Fert15N" |
gr |
Column name for Plant Growth Rate. Default: "GR" |
n_con |
Column name for N available for consumption. Default: "Ncon" |
n_rec |
Column name for N recycled. Default: "Nrec" |
n_loss |
Column name for N lost from system. Default: "Nloss" |
n_in |
Column name for Total N Input (System). Default: "Ni" |
n_out |
Column name for Total N Output (System). Default: "No" |
delta_soil_n |
Column name for Change in Soil N. Default: "delSoilN" |
mrt |
Column name for Mean Residency Time. Default: "MRT" |
Value
A dataframe with new columns appended for every calculable metric.
Examples
# Create a simple dataset
df <- data.frame(
YieldF = c(3.5, 4.2, 5.0),
Yield0 = c(2.0, 2.5, 3.0),
FertN = c(10, 10, 10)
)
# Run the batch calculator
result <- calculate_nue_batch(df)
# View calculated AE column
print(result$AE)
Calculate Ecological NUE (ecoNUE)
Description
The product of N productivity and mean residency time (MRT). Formula: ecoNUE = NP * MRT
Usage
ecoNUE(NP, MRT)
Arguments
NP |
Nitrogen Productivity Value. |
MRT |
Mean Residency Time value. |
Value
A numeric vector of ecoNUE values.
Examples
NP <- c(10, 12)
MRT <- c(4, 5)
ecoNUE(NP, MRT)
Plot NUE Comparison
Description
Creates a bar chart comparing NUE metrics across different groups (e.g., Treatments or Sites). Includes error bars (Standard Error).
Usage
plot_nue_compare(data, x_var, y_var)
Arguments
data |
A dataframe containing the results. |
x_var |
The column name to group by (e.g., "Treatment", "Year"). |
y_var |
The NUE metric to plot (e.g., "AE", "NRE"). |
Value
A ggplot object.
Examples
# Create dummy data
df <- data.frame(
Treat = c("A", "A", "B", "B"),
AE = c(10, 12, 20, 22)
)
# Plot
plot_nue_compare(df, x_var = "Treat", y_var = "AE")
Calculate N Balance Index of a System (sNBI)
Description
The accumulation or reduction of soil N over a set time. Formula: sNBI = Ni - No - delSoilN
Usage
sNBI(Ni, No, delSoilN)
Arguments
Ni |
Sum total of N inputs (vector or value). |
No |
Sum total of N outputs (vector or value). |
delSoilN |
Change in total soil N value. |
Value
A numeric vector of sNBI values.
Examples
Ni <- c(100, 120)
No <- c(80, 90)
delSoilN <- c(5, -2)
sNBI(Ni, No, delSoilN)
Calculate NUE of a System (sNUE)
Description
The fraction of system N outputs that are captured as N yield. Formula: sNUE = YieldN / (YieldN + Nloss)
Usage
sNUE(YieldN, Nloss)
Arguments
YieldN |
Observed crop yield N. |
Nloss |
N lost from the system. |
Value
A numeric vector of sNUE values.
Examples
YieldN <- c(80, 90, 100)
Nloss <- c(20, 25, 20)
sNUE(YieldN, Nloss)