dbCheckTable_station_adlershof: Check data in the 'station_adlershof' table and flag bad data...

Description Usage Arguments Details Examples

View source: R/db_correction.R

Description

This function allows to interactively select bad data points of a selected md_id and a period defined by start_datetime and end_datetime. This points will be flagged with the quality flag qf_id_bad and NA values in station_adlershof_correcting while the rest of the points will be flagged with qf_id_good. Currently, this function does not offer a way to write other values than NA into station_adlershof_correcting; it is only meant for the case when the data is not correctable.

Usage

1
2
3
4
5
6
7
8
dbCheckTable_station_adlershof(
  conn,
  start_datetime = NULL,
  end_datetime = NULL,
  md_id,
  qf_id_good = 1,
  qf_id_bad = 10
)

Arguments

conn

Database connection.

start_datetime

Start date and time as a single POSIXct value.

end_datetime

End date and time as a single POSIXct value.

md_id

Integer vector of measurand ID.

qf_id_good

Integer value with 1 <= qf_id_good <= 9 that will be written to the non-selected points indicating value ok.

qf_id_bad

Integer value with qf_id_bad >= 10 that will be written to the selected points indicating value not ok and incorrectable.

Details

The data of the selected md_id and period is plotted unless some correcting entries in station_adlershof_correcting already refer to the selected data; in this case the function is aborted. Click on the bad points in the plot. These points will be marked with qf_id_bad and corresponding NA values are written to station_adlershof_correcting, while the rest is marked with qf_id_good. The bad points will be written to the terminal; you will have to confirm that the respective quality flags will be written. If there are already some quality flags set in the data, you will have to confirm to overwrite them.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
library(lubridate)

con <- dbConnect_klimageo(user = "klimageo_1")

start_datetime <- ymd_h("2018-12-17 00")
end_datetime <- ymd_h("2019-01-01 00")

# air temperature
dbCheckTable_station_adlershof(con, md_id = 5,
                               start_datetime = start_datetime,
                               end_datetime = end_datetime)
dbCheckTable_station_adlershof(con, md_id = 7,
                               start_datetime = start_datetime,
                               end_datetime = end_datetime)
dbCheckTable_station_adlershof(con, md_id = 9,
                               start_datetime = start_datetime,
                               end_datetime = end_datetime)
dbDisconnect(con)

## End(Not run)

sebschub/klimageodb documentation built on Sept. 25, 2021, 4:16 p.m.