BUG in format()? (PR#383)

About this list Date view Thread view Subject view Author view Other groups

Subject: BUG in format()? (PR#383)
jens.oehlschlaegel-akiyoshi@mdfactory.de
Date: Wed 22 Dec 1999 - 02:39:21 EST


Message-Id: <199912211639.RAA02470@pubhealth.ku.dk>

In RW0.651 and RW0.901,
I discovered some unexpected behaviour when I used as.matrix.data.frame()

> matrix('"', 2, 2)
     [,1] [,2]
[1,] "\"" "\""
[2,] "\"" "\""
> unclass(as.data.frame(matrix('"', 2, 2)))
$V1
[1] "\"" "\""

$V2
[1] "\"" "\""

attr(,"row.names")
[1] "1" "2"
> as.matrix(as.data.frame(matrix('"', 2, 2)))
  V1 V2
1 "\\\"" "\\\""
2 "\\\"" "\\\""

I traced it back to a call to format (probably .Internal(format, ...))

> format('"')
[1] "\\\""

> format('\\')
[1] "\\\\"

Same in format.char() but not in formatC()

This behaviour of format() is not intended, is it?
Regards

Jens

> version
         _
platform Windows
arch x86
os Win32
system x86, Win32
status
major 0
minor 90.1
year 1999
month December
day 15
language R

--
Dr. Jens Oehlschlägel-Akiyoshi
MD FACTORY GmbH
Bayerstrasse 21

80335 München

Tel.: 089 545 28-27 Fax.: 089 545 28-10 http://www.mdfactory.de

Standard Disclaimers: Opinions expressed here are personal and are not otherwise represented.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Tue 04 Jan 2000 - 14:16:11 EST