time_bp: Extract and set time in years before present for SpatRaster...

time_bpR Documentation

Extract and set time in years before present for SpatRaster and SpatRasterDataset

Description

This functions extracts and sets time in years BP (i.e. from 1950) for a terra::SpatRaster or a terra::SpatRasterDataset. In a terra::SpatRaster object, time is stored with unit "years", which are years from 0AD. This means that, when a summary of the terra::SpatRaster is inspected, the times will appear as time_bp+1950. The same applies when the function terra::time() is used instead of time_bp().

Usage

time_bp(x)

## S4 method for signature 'SpatRaster'
time_bp(x)

## S4 method for signature 'SpatRasterDataset'
time_bp(x)

time_bp(x) <- value

## S4 replacement method for signature 'SpatRaster'
time_bp(x) <- value

## S4 replacement method for signature 'SpatRasterDataset'
time_bp(x) <- value

Arguments

x

a terra::SpatRaster

value

a numeric vector of times in years BP

Value

a date in years BP (where negative numbers indicate a date in the past)


EvolEcolGroup/pastclim documentation built on Nov. 6, 2023, 5:11 a.m.