trimFieldsForPlotting: Subsets data from Field for plotting

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

trimFieldsForPlottingR Documentation

Subsets data from Field for plotting

Description

This is an internal helper function which pulls out the data needed to make a plot from a bunch of Fields, and returns a list of the Field with only the required layers and points in space and time included

Usage

trimFieldsForPlotting(
  fields,
  layers,
  years = NULL,
  days = NULL,
  months = NULL,
  seasons = NULL,
  gridcells = NULL,
  dropEmpty = FALSE
)

Arguments

fields

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

layers

A character vector of the layers to be plotted

years

The years to be extracted (as a numeric vector), if NULL all years are used

days

The days to be extracted (as a numeric vector), if NULL all days are used

months

The months to be extracted (as a numeric vector), if NULL all months are used

seasons

The months to be extracted (as a character vector), if NULL all seasons are used

gridcells

The months to be extracted (as a character vector), if NULL all seasons are used

dropEmpty

Logical, if TRUE drop layers consisting only of zeros

Value

Returns a list of Fields

Author(s)

Matthew Forrest matthew.forrest@senckenberg.de


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