[Rd] possible bug in 'scan'

Benjamin Tyner btyner at gmail.com
Tue Jun 26 17:58:35 CEST 2007


R-devel,

When I run the following code on the attached file,

tmp <- scan("C:/temp.csv",
            what=list("character","numeric"),
            sep=",")

Then tmp[[2]] is a character vector. My impression from the help file
is that it should be a numeric as specified by 'what'

> sessionInfo()
R version 2.5.0 (2007-04-23)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"
"methods"   "base"

other attached packages:
 lattice    gdata
"0.15-5"  "2.3.1"

My apologies if this is due to my misunderstanding.
Ben


More information about the R-devel mailing list