mg_function_check_number_complete_time_series: mg_function_check_number_complete_time_series

Description Usage Arguments Value Examples

View source: R/mg_function_check_number_complete_time_series.R

Description

Takes hydraulic head time series dataframe and counts the number of complete time series for a certain timespan

Usage

1
2
3
4
5
6
7
8
9
mg_function_check_number_complete_time_series(
  df,
  date_column_name,
  value_column_name,
  id_column_name,
  time_span_years,
  moving_window_width_days,
  fraction_of_NAs_allowed
)

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 name of the value column (numeric format)

id_column_name

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

time_span_years

number of years for which complete time series are searched

moving_window_width_days

number of days for which time_span_years is advancing (e.g. 30 to andvance 30 days)

fraction_of_NAs_allowed

fraction of missing values allowed to count as a complete time series

Value

list with two dataframes: df "number_of_timeseries" with 3 columns, start_zeitpunkt: start of time span end_zeitpunkt: end of time span anzahl_ts: number of complete time series in this time span df "input_settings" contains the input data. Can be used with function mg_function_extract_spreaded_ts

Examples

1
2
3
4
5
6
7
 mg_function_check_number_complete_time_series(df = wasserstand_projekt,
                                               value_column_name = "mean_value",
                                               date_column_name ="mean_date",
                                               id_column_name = "datenquelle",
                                               time_span_years = 10,
                                               moving_window_width_days = 30,
                                               fraction_of_NAs_allowed = 0.1)

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