Skip to contents

trend_class creates trend and trend class rasters from user specified time periods.

Usage

trend_class(
  irast,
  areaname,
  end,
  period = 10,
  classes = "supplementary/trend_classes.csv",
  ext = ".tif"
)

Arguments

irast

Character file path to input veg density rasters that have been masked and found in either `veg_dens_mskd\` or `veg_dens_mskd_cld\`.

areaname

Character vector representing the geographical area that the user is processing. It is good practice to add in the satellite sensor used to create the index images to help keep track of the source. Just do not add any numbers to the names. An example might be "lgcsmp_lsat" or "lgcsmp_sent" for Lalang-garram landsat and Lalang-garram sentinel respectively. It will be used for inclusion to the output csv name.

end

Numeric denoting final year of analysis.

period

Numeric denoting intended length of trend analysis. Note that periods are matched to class bins so ensure that appropriate period length is entered otherwise results will be meaningless. Default is 10.

classes

Character representation of the name of the trend class csv file including file path. Default is "supplementary/trend_classes.csv" which works with the suggested project folder structure and workflow.

ext

Character representation of the file extension of the input rasters. Defaults to ".tif" as this is the preferred file type.

Value

A raster of slope values and a raster of trend classes are written to `trend_class\` for the intended period of analysis.

Details

Given an end year and a period length this function stacks the appropriate annual rasters and outputs a linear trend raster and a trend class raster based on a user supplied classification in csv format. The csv must have the following three column format so that each row forms a bin:

  • lower - numerical low value for bin

  • upper - numerical high value (<=) for bin

  • reclass - numerical classification value

This classification is based on binning the slope values from the regression and is therefore sensitive to the period length. Ensure that the classification matches the intended period of analysis.

Note to accommodate any missing annual rasters, due to for example availability of suitable imagery, the function will create "dummy" rasters to pad the stack accordingly. These "dummy" rasters ensure the time variable is handled correctly in the regression. These "dummies" are deleted as the function cleans up after itself.

Author

Bart Huntley, bart.huntley@dbca.wa.gov.au

Examples

if (FALSE) { # \dontrun{
trend_class(irast = "veg_dens_mskd_cld", areaname = "lgscmp_lsat",
    end = 2023)
} # }