mg_function_time_series_preparation: mg_function_time_series_preparation

Description Usage Arguments Value Examples

View source: R/mg_time_series_prep.R

Description

Takes hydraulic head time series datafram and calculates mean values and dates for a certain timespan. df,date_column_name,value_column_name,timespan

Usage

1
2
3
4
5
6
7
mg_function_time_series_preparation(
  df,
  date_column_name,
  value_column_name,
  id_column_name,
  timespan_weeks
)

Arguments

df

dataframe which contains the value and date column

date_column_name

column name of the date column (should be format date)

value_column_name

column name1of the value column (numeric format)

id_column_name

column name of identifier column (e.g. name of Grundwasssermessstelle) (character format)

timespan_weeks

number of weeks for which mean value and mean date are calculated

Value

input dataframe with 4 new columns, timespan_weeks: mean isoweek of timespan (e.g. isoweek 49-51 –> 50) timespan_weeks_label: character column showing the isoweeks e.g. '49-51' mean_value: mean value in time span mean_date: mean date in time span (format date)

Examples

1
2
3
4
test<- mg_function_time_series_preparation(df = wasserstand_projekt,
date_column_name = "datum",
value_column_name = "mess_wert",
timespan = 3)

mghydro/LSHydroMG documentation built on Jan. 28, 2022, 3:31 p.m.