fertApp {Rquefts} | R Documentation |
Optimal fertilizer application
Description
Compute the optimal fertilizer application rates given a target nutrient application and the available products (fertilizer blends) and their prices.
Usage
fertApp(nutrients, fertilizers, price, exact=TRUE, retCost=FALSE)
Arguments
nutrients |
data.frame with columns "N", "P", "K" in kg (per unit area) |
fertilizers |
data.frame with fertilizer products (see examples) |
price |
numeric. Vector with fertilizer product prices. Should have length of |
exact |
logical. If |
retCost |
logical. If |
Examples
# fertilizer product list
fert <- fertilizers()
# shortening some of the names for display
fert[,2] = substr(fert[,2], 1, 20)
# contents are expressed as a percentage.
ferts <- fert[c(8,15:17), 2:5]
ferts
x <- fertApp(data.frame(N=100, P=50, K=50), ferts, c(1, 1.5, 1.25, 1))
# show that it is correct
nutrientRates(ferts, x[,2])
fertApp(data.frame(N=seq(0,200,50), P=50, K=50), ferts, c(1, 1.5, 1.25, 0.75))
fertApp(data.frame(N=seq(0,200,50), P=50), ferts[,-3], c(1, 1.5, 1.25, 0.75))
fertApp(data.frame(N=seq(0,200,50), P=50), ferts[,-3], c(1, 1.5, 1.25, 5.75))
[Package Rquefts version 1.2-3 Index]