powered by
This function calculates the average age of the grass
calc_grass_age(ID, B_LU_BRP)
The age of the grassland within a crop rotation plan. A numeric value.
(numeric) The ID of the field
(numeric) The crop code (gewascode) from the BRP
The function assumes that the order of crop codes are descending, so the latest year is on top.
calc_grass_age(ID = rep(1,5), B_LU_BRP = c(1091,265,256,256,1091)) calc_grass_age(ID = rep(1,5), B_LU_BRP = c(265,265,265,265,1091))
Run the code above in your browser using DataLab