truncate_phenocam: Truncate a PhenoCam time series

Description Usage Arguments Value Examples

View source: R/truncate_phenocam.r

Description

The 'expand_phenocam()' function provides a similar functionality and is prefered. This function remains as it might serve a purpose to some. Might be deprecated in the future.

Usage

1
truncate_phenocam(data, year = 2015, internal = TRUE, out_dir = tempdir())

Arguments

data

a PhenoCam file or data frame

year

the last valid year, discard the rest

internal

return a data structure if given a file on disk (TRUE / FALSE = default)

out_dir

output directory where to store data (default = tempdir())

Value

A truncated PhenoCam data structure or file, with data limited to the year specified.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# download demo data
download_phenocam(site = "harvard$",
                  veg_type = "DB",
                  roi_id = "1000",
                  frequency = "3")
                  
# overwrites the original file, increasing
# decreasing the file size, with given year as maximum.
truncate_phenocam(file.paste(tempdir(),"harvard_DB_1000_3day.csv"),
                  year = 2015)

## End(Not run)

bnasr/phenocamrCS documentation built on June 5, 2020, 3:52 a.m.