trs | R Documentation |
Resamples time series by summary statistics, and returns complete time series with new time resolution. (wind data is acceptable)
trs(
df,
bkip,
st = NULL,
et = NULL,
fun = "mean",
probs = 0.5,
na.rm = TRUE,
wind = FALSE,
coliws = 2,
coliwd = 3,
cpms = TRUE
)
df |
dataframe of time series. |
bkip |
new resolution breaking input of time series, such as '1 hour'. |
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. |
fun |
a function to compute the summary statistics which can be applied to all data subsets: 'sum', 'mean', 'median', 'min', 'max', 'sd' and 'quantile'. |
probs |
numeric vector of probabilities with values in \([0,1]\). |
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. |
If you have wind data (wind speed, and wind direction in dgree), please set 'wind' as 'TRUE', and set values for 'coliwd' and 'coliws'.
a dataframe which contains a time series for summary statistics with a new time resolution.
trs(met, bkip = "1 hour", st = "2017-05-01 00:00:00", wind = TRUE, coliws = 4, coliwd = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.