formatNA: Print NA values by a Desired Code

formatNAR Documentation

Print NA values by a Desired Code

Description

Recodes the NA entries in output by a desired code like " ."

Usage

formatNA(x, na.print = " .", digits = getOption("digits"), ...)

Arguments

x

object to be printed, usually a numeric vector or data.frame

na.print

code to be used for NA values

digits

number of digits for formatting numeric values

...

other arguments to format

Details

The na.encode argument of print only applies to character objects. formatNA does the same for numeric arguments.

Value

Should mimik the value of format

Author(s)

Werner A. Stahel

See Also

format

Examples

formatNA(c(1,NA,3))

dd <- data.frame(X=c(1,NA,3), Y=c(4,5, NA), g=factor(c("a",NA,"b")))
(rr <- formatNA(dd, na.print="???"))
str(rr)

relevance documentation built on May 1, 2023, 5:20 p.m.