UpdateSubsets.Rd 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. \name{UpdateSubsets}
  2. \alias{UpdateSubsets}
  3. \title{Updating Subset List}
  4. \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.
  5. }
  6. \usage{UpdateSubsets(LoadDat, StartDate=FALSE, Dir=".")}
  7. \arguments{
  8. \item{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.
  9. }
  10. \item{StartDate}{Logical: Specifying whether StartDate was specified in the original MODISSubset download.}
  11. \item{Dir}{String: Directory where previously downloaded subsets are saved. Default is current working directory.}
  12. }
  13. \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.}
  14. \value{A dataframe containing any data for which a subset has not been downloaded. This can then be used with MODISSubsets.}
  15. \author{Helen Phillips and Sean Tuck}
  16. \seealso{\code{\link[MODISTools:MODISSubsets]{MODISSubsets}}}
  17. \examples{
  18. \dontrun{
  19. # dontrun() used because running the example requires internet access.
  20. data(SubsetExample, ConvertExample)
  21. modis.subset <- ConvertToDD(XY = ConvertExample, LatColName = "lat", LongColName = "long")
  22. modis.subset <- data.frame(lat = c(SubsetExample$lat, modis.subset[ ,1]),
  23. long = c(SubsetExample$long, modis.subset[ ,2]),
  24. start.date = rep(SubsetExample$start.date, 9),
  25. end.date = rep(SubsetExample$end.date, 9))
  26. MODISSubsets(LoadDat = SubsetExample, Product = "MOD13Q1", Bands = c("250m_16_days_EVI",
  27. "250m_16_days_pixel_reliability"), Size = c(0,0), StartDate = TRUE)
  28. Updated.modis.subset <- UpdateSubsets(LoadDat = modis.subset, StartDate = TRUE)
  29. MODISSubsets(LoadDat = Updated.modis.subset, Product = "MOD13Q1", Bands = c("250m_16_days_EVI",
  30. "250m_16_days_pixel_reliability"), Size = c(0,0), StartDate = TRUE)
  31. }
  32. }