[R] How to avoid converting "_" to "." ?

Peter Dalgaard p.dalgaard at biostat.ku.dk
Fri Oct 24 23:08:30 CEST 2003


ryszard.czerminski at pharma.novartis.com writes:

> It is minor thing, but how can I avoid converting "_" to "." ?
> 
> e.g. I have a data set "test.csv"
>  
> A,A_B,A_C,C,D
> X,11,0,13,14
> Y,21,0,23,24
> 
> and when I read it all underscores are converted to dots (:<)
> 
> > d <- read.csv("test.csv")
> > d
>   A A.B A.C  C  D
> 1 X  11   0 13 14
> 2 Y  21   0 23 24

Add check.names=FALSE (see ?read.csv).

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list