knitr::opts_chunk$set( collapse = TRUE, comment = "#>") library(data.table) library(fertplan)
This document will walk you through a simulation of a real fertilization plan for nitrogen nutrient. Both fertplan
and this document depend on package data.table
but its usage is not in any way mandatory.
The estimation of the fertilization plan strictly follow the indications formulated in the regulation drawn up by the Italian Region of Lazio [@guidelines2020], hereafter the guidelines. The estimation of nitrogen demand for a yearly crop is the most complex among the ones detailed in the guidelines.
Nitrogen fertilization concentration in kg/ha is estimated as the net resultant of a N balance between the nitrogen pool available for the crops and the nitrogen losses. The N balance involves 7 main flow components. Flows that increase N availability to the crop are > 0 (positive sign). Flows that deplete soil N pool or N availability for the crop are < 0 (negative sign).
The N flow components include:
The final nitrogen balance is computed as the sum of its 7 components: $$B_N = \sum_{i=1}^{7}f_{N,i}$$
The main pathway to get to B_N includes 4 steps.
Let's begin with some minimal data from soil physical and chemical analyses on a few sampling points in the field.
data(soils) soil_dt <- soils[, c("id", "N_pc", "CNR", "SOM_pc", "Clay_pc")] knitr::kable(soil_dt)
The table shows the soil chemical and physical status before the planned crop sowing. The soil analyses elements that will be fed the nitrogen balance estimation are:
The id feature is not relevant to the balance estimation.
A few environmental and crop-related variables need to be set. Some variables need to match those set out in the guidelines tables, while a few others have to be derived from external sources.
Let's first translate the guidelines tables into english:
fertplan::i18n_switch("lang_en")
Matching-variables are:
fertplan
implementation of the table has separated the crop column into two features, the actual "crop" and "part" (eg fruits, whole plant, and so on). The available crops are:knitr::kable(fertplan::get_available("crop"))
Crops are organized into crop types for convenience:
knitr::kable(fertplan:::tables_l$all_01_dt[crop == "Durum wheat" & element == "N",])
As a reference crop parts include:
knitr::kable(fertplan::get_available("part"))
knitr::kable(fertplan::get_available("crop type"))
knitr::kable(gsub( "%", "\\\\%", fertplan:::tables_l$tab_05_dt[, crop]), escape = FALSE)
Texture, soil texture, one of r paste0("'", get_available('soil texture'), "'", collapse = ", ")
. Soil texture enters in several flows of the nitrogen balance.
Drainage rate, it contributes to $f_{N,d}$ component, can be one of r paste0("'", get_available('drainage'), "'", collapse = ", ")
. Drainage rate is looked up in table 4 (page 23) of guidelines together with soil texture.
Environmental and crop-related variables include:
Expected yield, it contributes to $f_{N,a}$ component, unit of measure kg/ha. It can be estimated from statistical estimates of crop areas and yields at province, regional, or national level. As an example, wheat expected yield is 2,900 kg/ha in the province of Rome, based on 2019 Istat estimates.
Rainfall October - January, this is the cumulative rainfall in mm during 4 autumn and winter months, from October to January. It contributes to the C component where nitrogen leaching is estimated as a quantity proportional to rainfall.
Previous organic fertilization, this is the supply of nitrogen in kg/ha from the organic fertilization performed during previous crop(s). It contributes to the $f_{N,f}$ component. No organic fertilization may be passed as a 0-value to this variable.
Organic fertilizer, this is the type of organic fertilizer as found in table 6 (page 25) of the guidelines: r paste0("'", get_available('organic fertilizer'), "'", collapse = ", ")
. It contributes to the $f_{N,f}$ component.
Years from previous organic fertilization, this contributes to the $f_{N,f}$ component, to compute the quantity of available N left in the soil, table 6 (page 25) of the guidelines. It can either be r paste0("'", get_available('frequency'), "'", collapse = ", ")
years.
N from atmosphere or N-fixing bacteria, this contributes to the $f_{N,g}$ component and takes the form of a coefficient in the range from 0 to 1 to be applied to the value of 20 kg/ha estimated for a yearly crop close to urban settlements.
Let's now set the variables values and bind them to the soil analysis table. Let's suppose the values are constant among all soil samples, as it may be the case when all sampling points come from a uniform field that will be sown with the same crop:
soil_l <- list( crop = "Durum wheat", part = "Seed", crop_type = "Fall / winter crops", expected_yield_kg_ha = 2900L, prev_crop = "Meadows: polyphyte <5% fodder legumes", texture = "Loam", drainage_rate = "Slow", oct_jan_pr_mm = 350L, n_supply_prev_frt_kg_ha = 0L, n_supply_atm_coeff = 1)
Let's compute each component of the nitrogen balance:
nutrient_dt <- demand_nutrient( soil_dt, soil_l, nutrient = "nitrogen", blnc_cmpt = TRUE) knitr::kable(nutrient_dt)
All components were estimated, note that $f_{N,b}$ is computed as (b1+b2)*-1
. Remember that positive values are demand pools of N in soil or N flows leaving the field (such as $f_{N,c}$ component); negative values are current N pools in the soils that are available for assimilation to the crop or that will be available during the time-frame of crop growth.
fertzl_dt <- cbind(nutrient_dt, soil_dt) fertzl_cols <- grep( pattern = "^[A-G]_N_kg_ha$", x = colnames(nutrient_dt), value = TRUE) knitr::kable(fertzl_dt)
We are finally arrived to the last step of assembling all components of the N balance. Let's perform the actual addition of the r paste0(fertzl_cols, collapse = ", ")
components:
fertzl_dt[, n_demand_kg_ha := rowSums(.SD), .SDcols = fertzl_cols] knitr::kable(fertzl_dt[, c("id", "n_demand_kg_ha")])
All sampling points end up needing a supply of nitrogen of r fertzl_dt[, mean(n_demand_kg_ha)]
kg/ha on average.
A more direct pathway to get to B_N estimation is to set argument blnc_cmpt
of demand_nutrient
function to FALSE
(the default setting). This will have the effect of returning directly B_N instead of its balance components thereby skipping the fourth step:
nutrient_dt <- demand_nutrient( soil_dt, soil_l, nutrient = "nitrogen", blnc_cmpt = FALSE) knitr::kable(nutrient_dt)
That's it as far as nitrogen fetilization plan is concerned.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.