Nitrogen Rate Estimation from NDVI using Calibration
Source:R/estimate_N_rate_from_calibration_curve.R
estimate_N_rate_from_calibration_curve.RdThis function estimates nitrogen (N) application rates based on NDVI values using either a two-point or three-point calibration method.
Usage
estimate_N_rate_from_calibration_curve(
raster,
minN,
maxN,
meanN = NULL,
calibration_type = "two-point",
plot = FALSE
)Arguments
- raster
A
raster::RasterLayerwith NDVI values, or aRasterBrick/RasterStack(the layer namedNDVIis used if present, otherwise the first layer).- minN
The minimum N rate (kg/ha) corresponding to the minimum NDVI.
- maxN
The maximum N rate (kg/ha) corresponding to the maximum NDVI.
- meanN
The mean N rate (kg/ha) corresponding to the mean NDVI (only used for three-point calibration).
- calibration_type
The type of calibration to perform: "two-point" or "three-point". Default is "two-point".
- plot
A logical value indicating whether to create plots (default is FALSE).
Examples
# Load example NDVI raster (replace with your own)
# ndvi_raster <- raster::raster(system.file("extdata/s2.tif", package = "NFert"))
# Two-point calibration
# n_rate_raster_2pt <- estimate_N_rate_from_calibration_curve(ndvi_raster, minN = 40, maxN = 60)
# Three-point calibration
# n_rate_raster_3pt <- estimate_N_rate_from_calibration_curve(ndvi_raster, minN = 40, meanN = 50,
# maxN = 60, calibration_type = "three-point")