trs: Resample time series

Description Usage Arguments Details Value Examples

View source: R/trs.R

Description

Resamples time series, and returns complete time series with new time resolution. (wind data is acceptable)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
trs(
  df,
  bkip,
  colid = 1,
  st = NULL,
  et = NULL,
  na.rm = TRUE,
  wind = FALSE,
  coliws = 2,
  coliwd = 3,
  cpms = TRUE
)

Arguments

df

dataframe of time series.

bkip

new resolution breaking input of time series, such as '1 hour'.

colid

column index for date-time. The default value is 1.

st

start time of resampling. The default value is the fisrt value of datetime column.

et

end time of resampling. The default value is the last value of datetime column.

na.rm

logical value. Remove NA value or not?

wind

logical value. if TRUE, please set coliwd, coliws.

coliws

numeric value, column index of wind speed in dataframe.

coliwd

numeric value, column index of wind direction (degree) in dataframe.

cpms

logical value. Compensate the insufficient amount of the millisecond bit for datetime column.

Details

If you have wind data (wind speed, and wind direction in dgree), please set 'wind' as 'TRUE', and set values for 'coliwd' and 'coliws'.

Value

a dataframe which contains a time series with a new time resolution.

Examples

1
trs(met, bkip = "1 hour", st = "2017-05-01 00:00:00", wind = TRUE, coliws = 4, coliwd = 5)

GlossyBoat/foqat documentation built on Jan. 18, 2021, 11:31 p.m.