Learn R Programming

MODISTools (version 0.95.1)

UpdateSubsets: Updating Subset List

Description

A function that identifies, from a given dataset, which subsets have already been downloaded and returns a dataframe of those yet to be downloaded. A useful function if the list of locations for subsets is continually increasing or if download was halted previously.

Usage

UpdateSubsets(LoadDat, StartDate=FALSE, Dir=".")

Arguments

LoadDat
Input dataset: either the name of an object already in the workspace, or a file to be read in by specifying its file path as a character string, that has location data, end date (end.date) and study ID for each location.
StartDate
Logical: Specifying whether StartDate was specified in the original MODISSubset download.
Dir
String: Directory where previously downloaded subsets are saved. Default is current working directory.

Value

A dataframe containing any data for which a subset has not been downloaded. This can then be used with MODISSubsets.

Details

The input dataset should be organised accordingly: "lat" and "long" columns showing WGS-1984 decimal degrees latitudes and longitudes respectively; "end.date" for study end date.

See Also

MODISSubsets

Examples

Run this code
## Not run: ------------------------------------
# # dontrun() used because running the example requires internet access.
# 
# data(SubsetExample, ConvertExample)
# 
# modis.subset <- ConvertToDD(XY = ConvertExample, LatColName = "lat", LongColName = "long")
# modis.subset <- data.frame(lat = c(SubsetExample$lat, modis.subset[ ,1]),
#                            long = c(SubsetExample$long, modis.subset[ ,2]),
#                            start.date = rep(SubsetExample$start.date, 9),
#                            end.date = rep(SubsetExample$end.date, 9))
# 
# MODISSubsets(LoadDat = SubsetExample, Product = "MOD13Q1", Bands = c("250m_16_days_EVI", 
#              "250m_16_days_pixel_reliability"), Size = c(0,0), StartDate = TRUE)
# 
# Updated.modis.subset <- UpdateSubsets(LoadDat = modis.subset, StartDate = TRUE)
# 
# MODISSubsets(LoadDat = Updated.modis.subset, Product = "MOD13Q1", Bands = c("250m_16_days_EVI", 
#              "250m_16_days_pixel_reliability"), Size = c(0,0), StartDate = TRUE)
#   
## ---------------------------------------------

Run the code above in your browser using DataLab