From g.russell at eos-solutions.com  Wed Dec  2 10:55:12 2009
From: g.russell at eos-solutions.com (g.russell at eos-solutions.com)
Date: Wed,  2 Dec 2009 10:55:12 +0100 (CET)
Subject: [Rd] read.csv confused by newline characters in header (PR#14103)
Message-ID: <20091202095512.7F00E2831FFB@mail.pubhealth.ku.dk>

Full_Name: George Russell
Version: 2.10.0
OS: Microsoft Windows XP Service Pack 2
Submission from: (NULL) (217.111.3.131)


The following code (typed into R --vanilla)

testString <- '"B1\nB2"\n1\n'
con <- textConnection(testString)
tab <- read.csv(con,stringsAsFactors = FALSE)

produces a data frame with with one row and one column; the name of the column
is "B1.B2" (alright so far). However according to
print(tab[[1,1]])

the value of the entry in the first row and first column is

"B2\n1\n"

So B2 has somehow got into both the names of the data frame and its entry.
Either R is confused or I am. What is going on?



[Rd] read.csv confused by newline characters in header (PR#14103)
g.russell at eos-solutions.com