Learn R Programming

OBIC (version 4.2.3)

calc_grass_age: Calculate the average age of the grass

Description

This function calculates the average age of the grass

Usage

calc_grass_age(ID, B_LU_BRP)

Value

The age of the grassland within a crop rotation plan. A numeric value.

Arguments

ID

(numeric) The ID of the field

B_LU_BRP

(numeric) The crop code (gewascode) from the BRP

Details

The function assumes that the order of crop codes are descending, so the latest year is on top.

Examples

Run this code
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