powered by
genGetDates extracts the date of one or several images when the name of the layer includes the date in the "YYYYJJJ" format.
genGetDates
YYYYJJJ
genGetDates(str, ...)
character argument containing the date in julian format "YYYYJJJ".
character
arguments for nested functions:
format the format of the date being returned.
format
a Date class object with the date of the image.
Date
The function reads a date from a character class object in year-julian ("YYYYJJJ") format and returns a Date class object.
# NOT RUN { img <- matrix(1:16, ncol = 4, byrow = TRUE) r <- raster(img) names(r) <- c("RandomImage_2018034") spplot(r) genGetDates(names(r), format = "%Y%j") # }
Run the code above in your browser using DataLab