Ole Fredslund Christensen
2012-Jul-03 08:57 UTC
[Rd] print.data.frame function with option na.print=" " actually prints NA
Dear R developers I thought I better report this behavior. Example:> print(matrix(c(1,NA,1,1),2,2), na.print="")[,1] [,2] [1,] 1 1 [2,] 1> print(as.data.frame(matrix(c(1,NA,1,1),2,2)), na.print="")V1 V2 1 1 1 2 NA 1 The help-file for print.data.frame gives me the impression that it should be possible to specify the na.print option (na.print option works in print.default, and following the reference to the helpfile for the format function then default value of na.encode in that function is TRUE). When I study the code for print.data.frame is see that format.data.frame is used with option na.encode = FALSE. Is that the cause for the behavior I see ? If so, are there good reasons for having it this way ? Best Ole Christensen [[alternative HTML version deleted]]