contract_phenocam: Contracts the file from 1-day to a 3-day time step

View source: R/contract_phenocam.r

contract_phenocamR Documentation

Contracts the file from 1-day to a 3-day time step

Description

Reverts the 'expand_phenocam()' function in order to save space and generate files as outlined in the cited data paper. This routine is used as a post-production measure.

Usage

contract_phenocam(
  data,
  internal = TRUE,
  no_padding = FALSE,
  out_dir = tempdir()
)

Arguments

data

a phenocam data file with a 1 or 3 day time step

internal

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

no_padding

allow for padding to REMAIN or not (TRUE / FALSE = default)

out_dir

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

Value

A contracted PhenoCam 3-day time series to its original 3-day time step (if provided at a 1-day interval), also removes padding introduced by processing for 1-day data.

Examples


## Not run: 
# download demo data
download_phenocam(site = "harvard$",
                  veg_type = "DB",
                  roi_id = "1000",
                  frequency = "3")

# Overwrites the original file, increasing
# it's file size.
expand_phenocam(file.path(tempdir(),"harvard_DB_1000_3day.csv"))

# Contracts the file to it's original size, skipping
# two days.
contract_phenocam(file.path(tempdir(),"harvard_DB_1000_3day.csv"))

## End(Not run)

bluegreen-labs/phenocamr documentation built on Feb. 6, 2024, 10:42 p.m.