Learn R Programming

AlphaPart (version 0.9.8)

UnknownFuns: Change given unknown value to NA and vice versa.

Description

Unknown or missing values (NA in R) can be represented in various ways (as 0, 999, etc.) in different programs. isUnknown, unknownToNA, and NAToUnknown can help to change unknown values to NA and vice versa.

Usage

isUnknown(x, unknown=NA, ...)

unknownToNA(x, unknown, warning=FALSE, ...)

NAToUnknown(x, unknown, force=FALSE, call.=FALSE, ...)

# S3 method for default isUnknown(x, unknown, ...)

# S3 method for POSIXlt isUnknown(x, unknown, ...)

# S3 method for list isUnknown(x, unknown, ...)

# S3 method for data.frame isUnknown(x, unknown, ...)

# S3 method for matrix isUnknown(x, unknown, ...)

unknownToNA(x, unknown, warning = FALSE, ...)

# S3 method for default unknownToNA(x, unknown, warning, ...)

# S3 method for factor unknownToNA(x, unknown, warning, ...)

# S3 method for list unknownToNA(x, unknown, warning, ...)

# S3 method for data.frame unknownToNA(x, unknown, warning, ...)

NAToUnknown(x, unknown, force = FALSE, call. = FALSE, ...)

# S3 method for default NAToUnknown(x, unknown, force, call., ...)

# S3 method for factor NAToUnknown(x, unknown, force, call., ...)

# S3 method for list NAToUnknown(x, unknown, force, call., ...)

# S3 method for data.frame NAToUnknown(x, unknown, force, call., ...)

.unknownList(x, unknown)

Arguments

x

generic, object with unknown value(s)

unknown

generic, value used instead of NA

...

arguments pased to other methods (as.character for POSIXlt in case of isUnknown)

warning

logical, issue warning if x already has NA

force

logical, force to apply already existing value in x

call.

logical, look in warning

Author

Gregor Gorjanc

See Also

AlphaPart