# NOT RUN {
# getting the capturing date from the name of a MODIS image
imgPath <- 'MYD13A2.A2016361.h17v04.006.2017285133407.hdf'
modGetDates(imgPath)
# a list of the full file paths of MODIS images, mixing .hdf and .tif files
imgsPaths<-list('MYD13A2.A2013297.h17v04.006.2015269230726.hdf',
'MYD13A2.A2013313.h17v04.006.2015271071143.tif')
modGetDates(imgsPaths, format = "%Y%j")
# }
Run the code above in your browser using DataLab