[Rd] format() applied to an NA character string (PR#9616)

Gregor Gorjanc gregor.gorjanc at bfro.uni-lj.si
Wed Apr 18 12:49:19 CEST 2007


Peter Dalgaard <P.Dalgaard <at> biostat.ku.dk> writes:
> This happens on Linux too, given slightly larger widths:
> 
> R version 2.5.0 RC (2007-04-17 r41210)
> ....
> > x <- as.character(NA)
> > format(x,width=64)

I can confirm this on Linux also. 

> format(x,width=36)
[1] "NA                                  "
R> format(x,width=64)

 *** caught segfault ***
address 0x20202020, cause 'memory not mapped'

Traceback:
 1: switch(mode(x), "NULL" = "NULL", character = .Internal(format(x,     trim,
digits, nsmall, width, adj, na.encode, scientific)),     call = , expression = ,
"function" = , "(" = deparse(x),     raw = as.character(x),
prettyNum(.Internal(format(x, trim,         digits, nsmall, width, 3, na.encode,
scientific)), big.mark = big.mark,         big.interval = big.interval,
small.mark = small.mark,         small.interval = small.interval, decimal.mark =
decimal.mark,         zero.print = zero.print, preserve.width = if (trim)
"individual" else "common"))
 2: format.default(x, width = 64)
 3: format(x, width = 64)

Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status = Under development (unstable)
 major = 2
 minor = 6.0
 year = 2007
 month = 04
 day = 18
 svn rev = 41219
 language = R
 version.string = R version 2.6.0 Under development (unstable) (2007-04-18 r41219)

Gregor



More information about the R-devel mailing list