ManagementData {growR}R Documentation

Management Data Class

Description

Management Data Class

Management Data Class

Details

Data structure that contains management data which can serve as input to a ModvegeSite simulation run.

Public fields

management_file

string The file that was read.

is_empty

boolean Used to determine if management data is present or not. In the latter case, ModvegeSite will simulate management decisions automatically.

years

List of unique years for which data is available.

cut_years

numeric Vector of length N where N is the total number of cuts read from the input file. Gives the year in which corresponding cut was made.

cut_DOY

numeric Vector of length N giving the day of year (as an integer) on which a cut was made.

intensity

string Management intensity for "autocut". One of c("high", "middle", "low").

Methods

Public methods


Method new()

Create a new ManagementData object.

Usage
ManagementData$new(management_file = NULL, years = NULL)
Arguments
management_file

string Path to file containing the management data to be read.

years

numeric Vector of years for which the management is to be extracted.


Method read_management()

Read management data from supplied management_file.

Usage
ManagementData$read_management(management_file, years = NULL)
Arguments
management_file

Path to or name of file containing management data.

years

Years for which the management is to be extracted. Default (NULL) is to read in all found years.

Returns

None The object's field are filled.


Method ensure_file_integrity()

Check that all required columns are present and that cut DOYs are only increasing in a given year.

Usage
ManagementData$ensure_file_integrity(cut_data)
Arguments
cut_data

data.frame containing the cut data.


Method get_management_for_year()

Extract management data for given year

This simply filters out all data not matching year and returns a list with the relevant keys.

Usage
ManagementData$get_management_for_year(year)
Arguments
year

integer Year for which to extract management data.

Returns

M A list containing the keys:

is_empty

boolean Used to determine if management data is present or not. In the latter case, ModvegeSite will simulate management decisions automatically.

cut_years

numeric Vector of length N where N is the total number of cuts for this year, as read from the input file. Gives the year in which corresponding cut was made.

cut_DOY

numeric Vector of length N giving the day of year (as an integer) on which a cut was made.

intensity

string Management intensity for "autocut". One of c("high", "middle", "low").

n_cuts

integer Number of cuts occurring in given year.

The two vectors in cut_DOY and cut_years differ from this object's respective fields in that only data for selected year is present.


Method clone()

The objects of this class are cloneable with this method.

Usage
ManagementData$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

ManagementData⁠$read_management()⁠


[Package growR version 1.2.0 Index]