exclude: Exclude Values

View source: R/Quality_checking.R

excludeR Documentation

Exclude Values

Description

Interactive plots are used for identification and flagging of data for exclusion based on the visual inspection.

Usage

exclude(x, qc_x = NULL, y = NULL, z = NULL, name_out = "-", win_size = 672)

Arguments

x

A numeric vector with values to inspect.

qc_x

An integer vector in the range 0 - 2 providing quality control information about x.

y, z

A numeric vector with values of auxiliary variable helping with the interpretation of x.

name_out

A character string providing varnames attribute value of the output.

win_size

An integer. Number of x values displayed per plot.

Details

Six options are available during the interactive session.

  1. flag values: select interval of values to exclude or use double-click to flag single value.

  2. undo last: allows to change the user flagging input back to the state before last flagging.

  3. refresh plots: apply current user flagging input to the plots. It removes excluded points and affects y-axis range or it can show again excluded points if option 2 (undo last) was applied before.

  4. next plot.

  5. jump to plot: any plot within the existing range (see as a plot title) can be selected.

  6. finalize: finish the flagging and return the results.

The interactive session will be finished successfully also when option 4 (next plot) is executed while at the last plot.

Value

An integer vector with attributes "varnames" and "units".

See Also

check_manually

Examples

## Not run: 
# prepare mock data
set.seed(87)
my_var <- sin(seq(pi / 2, 2.5 * pi, length = 48)) * 10
my_var[my_var > 5] <- 5
PAR <- (-my_var + 5) * 100
Tair <- rep(-cos(seq(0, 2 * pi, length = 48)), 14)
Tair <- Tair * 2 + 15 + seq(0, 5, length = 48 * 14)

# combine into data frame
a <- data.frame(
  my_var = my_var + rnorm(48 * 14),
  my_qc = sample(c(0:2, NA), 672, replace = TRUE, prob = c(5, 3, 2, 1)),
  PAR = PAR,
  Tair = Tair
)

# include spikes
a$my_var[c(152, 479)] <- c(231, -2000)

# flag data manually
exclude(x = a$my_var, qc_x = a$my_qc)
exclude(x = a$my_var, qc_x = a$my_qc, y = a$PAR)
exclude(x = a$my_var, qc_x = a$my_qc, y = a$PAR, z = a$Tair)

## End(Not run)


lsigut/openeddy documentation built on Jan. 15, 2025, 8:14 a.m.