incadata (version 0.5.3)

as.incadata: Coerce to object of class "incadata"

Description

Functions to check if an object is of class incadata, or coerce it if possible.

Usage

as.incadata(x, ...)

is.incadata(x)

# S3 method for data.frame as.incadata(x, decode = TRUE, id = TRUE, ask = TRUE, ...)

# S3 method for default as.incadata(x, n_i = NULL, ...)

Arguments

x

vector or data frame with data from INCA or Rockan.

...

arguments passed to exceed_threshold

decode

Should decode be applied to variables with identified variable names? (TRUE by default).

id

Should an id-column be added? This is based on PERSNR/PNR/PAT_ID if available (in that order) but is not set to NA for non valid pins (see as.pin).

ask

ask for input if unsure how to coerce variables

n_i

used internally

Value

as.incadata.data.frame

object of class incadata based on the "tibble"-class used within the "tidyverse"

as.incadata.default

input coerced to relevant class

is.incadata

TRUE if its argument is of class incadata and FALSE otherwise.

Details

If the function is called on a "big" data set, it might be time consuming and it might be quite verbose about performed class transformation. It would probably be worth the time when run locally for a specified task but if run as production code on INCA, some caution might be advised! Use suppressMessages to avoid the verbose output.