mergeFieldsForPlotting: Merge data from Field for plotting

View source: R/plotting-framework-functions.R

mergeFieldsForPlottingR Documentation

Merge data from Field for plotting

Description

This is an internal helper function which pulls out the data from a bunch of Fields to be plotted, adds columns to describe the characteristics of each Field (ie Quantity, Site code etc) and returns it all in one big melted data.table.

Usage

mergeFieldsForPlotting(
  fields,
  add.Quantity = FALSE,
  add.Site = FALSE,
  add.Region = FALSE,
  add.Years = FALSE
)

Arguments

fields

The list of Fields to be plotted (should have been check by santiseFieldsForPlotting first)

add.Quantity

Logical, if TRUE add a column with the Quantity name of each Field

add.Site

Logical, if TRUE add a column with the with a string containing the Lon and Lat of each site (gridcell).

add.Region

Logical, if TRUE add a column with the with a string containing the Region (as defined by the spatial.extent.id) of each Field.

add.Years

Logical, if TRUE add a column (with name "Years") with a string containing the first and last years of each Field (as defined by first.year and last.year).

Value

Returns a data.table

Author(s)

Matthew Forrest matthew.forrest@senckenberg.de


MagicForrest/DGVMTools documentation built on Aug. 23, 2024, 8:05 a.m.