subsetGridlist: Select a subset of a gridlist

Description Usage Arguments Value Author(s)

View source: R/subsetGridlist.R

Description

Crop a gridlist to an smaller area. Grridlist taken as a file in the form of a table of text (first and second columsn assume to be longitude and latitude repsective) or a data.frame with columns "Lon" and "Lat". The smaller area is anything from which a raster::Extent can be derived.

Usage

1
subsetGridlist(gridlist, area, file.name, header = TRUE, offset = c(0, 0))

Arguments

gridlist

A character string giving the location of the original gridlist which will be read by read.table and the first two columns will be assumed to be Lon then Lat, _or_ a data.frame wth columns Lon and Lat.

area

A raster::Extent or a SpatialExtent object specifying the geograpical sub-domain required

file.name

A character string specifying a path to write the new gridlist (can be ignored to write no file)

header

Logical, whether or not the original file has a header

offset

A two-member numeric vector specifying the longitude-latitude offset from the given coordinates to the gridcell centre, ie. should be c(0.25,0.25) for old LPJ-GUESS gridlists, and c(0.0,0.0) for most other more sensible scenarios

Value

The new gridlist as a data.frame (is also written to a file if file.name is provided)

Author(s)

Matthew Forrest matthew.forrest@senckenberg.de


MagicForrest/GUESSTools documentation built on July 2, 2020, 9:51 p.m.