UpdateSubsets: Updating Subset List

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/UpdateSubsets.R

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

1
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.

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.

Value

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

Author(s)

Helen Phillips and Sean Tuck

See Also

MODISSubsets

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## 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)
  
## End(Not run)

seantuck12/MODISTools documentation built on May 29, 2019, 4:55 p.m.