[R] re ad .csv separated with coma
Eik Vettorazzi
E.Vettorazzi at uke.uni-hamburg.de
Tue Mar 18 10:57:29 CET 2008
You should skip the first 3 rows by using option skip=3 and set
header=FALSE, which defaults to TRUE.
But you could also use the 3rd row as header, doing so by setting skip=2.
z <-read.csv(pathname, skip=3, header=F)
or
z <-read.csv(pathname, skip=2)
(By the way, it is obvious not necessary to set sep="," in read.csv!)
hth.
mysimbaa schrieb:
> Dear R users,
> I try to read .csv composed of two rows which are separated with coma in the
> followin manner:
> 1.ignore the three first lines
> 2. read datas separated with coma.
>
> I tried the following :
> pathname <- file.choose()
> z <-read.csv(pathname, sep = "," )
> t=z[,1]
> p=z[,2]
>
> But when I tape p I have NULL !!!
>
> My .csv is looking like :
>
> 0011J06
> 2008 Mrz 17 11:15
> Sample #, Measurement
> 1, -9.998E-6
> 2, 5.099E-4
> 3, 3.999E-5
> 4, 2.999E-4
> 5, 2.099E-4
>
> Thanks for help.
> Adel
>
>
--
Eik Vettorazzi
Institut für Medizinische Biometrie und Epidemiologie
Universitätsklinikum Hamburg-Eppendorf
Martinistr. 52
20246 Hamburg
T ++49/40/42803-8243
F ++49/40/42803-7790
More information about the R-help
mailing list