powered by
Recodes the NA entries in output by a desired code like " ."
NA
.
formatNA(x, na.print = " .", digits = getOption("digits"), ...)
Should mimik the value of format
format
object to be printed, usually a numeric vector or data.frame
code to be used for NA values
number of digits for formatting numeric values
other arguments to format
Werner A. Stahel
The na.encode argument of print only applies to character objects. formatNA does the same for numeric arguments.
na.encode
print
formatNA
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)
Run the code above in your browser using DataLab