condense_by_stat: Condense a data.frame to daily resolution

View source: R/get_ts.R

condense_by_statR Documentation

Condense a data.frame to daily resolution

Description

Cndense according to day_start, day_end, and the local solar mean time of the site

Usage

condense_by_stat(ts, condense_stat, site_lon, day_start, day_end)

Arguments

ts

the ts dataframe to condense

condense_stat

function name used to condense observations to ‘match_var'’s timestep (only for variables with more frequent observations than 'match_var'), or the term 'match' to indicate that the function defined in 'method' will be used to match the timestep of 'match_var'. Function names should be unquoted, where as 'match' should be string. Examples of what to use: mean (default), median, max, and min. A custom function can also be used, but it's input must be a numeric vector and output must be a single numeric value.

site_lon

the longitude of the site

day_start

start time (inclusive) of a day's data in number of hours from the midnight that begins the date. For example, day_start=-1.5 indicates that data describing 2006-06-26 begin at 2006-06-25 22:30, or at the first observation time that occurs after that time if day_start doesn't fall exactly on an observation time. For metabolism models working with single days of input data, it is conventional/useful to begin the day the evening before, e.g., -1.5, and to end just before the next sunrise, e.g., 30. For multiple consecutive days, it may make the most sense to start just before sunrise (e.g., 4) and to end 24 hours later. For nighttime regression, the date assigned to a chunk of data should be the date whose evening contains the data. The default is therefore 12 to 36 for metab_night, of which the times of darkness will be used.

day_end

end time (exclusive) of a day's data in number of hours from the midnight that begins the date. For example, day_end=30 indicates that data describing 2006-06-26 end at the last observation time that occurs before 2006-06-27 06:00. See day_start for recommended start and end times.


USGS-R/mda.streams documentation built on June 3, 2023, 8:43 a.m.