genGetDates: Return the capturing date from the name of a raster layer

Description Usage Arguments Details Value Examples

View source: R/genGetDates.R

Description

genGetDates extracts the date of one or several images when the name of the layer includes the date in the "YYYYJJJ" format.

Usage

1

Arguments

str

character containing the date as "YYYYJJJ", where Y and J are year and julian day digits.

...

arguments for nested functions:

  • format the format of the date being returned.

Details

The function reads a date from a character class object in year-julian ("YYYYJJJ") format and returns a Date class object.

Value

a Date class object with the date of the image or character class, if format argument is used.

Examples

1
2
3
4
5
6
img <- matrix(1:16, ncol = 4, byrow = TRUE)
r <- raster(img)
names(r) <- c("RandomImage_2018034")

spplot(r)
genGetDates(names(r), format = "%Y%j")

RGISTools documentation built on July 2, 2020, 3:58 a.m.