Re: [R] re ad .csv separated with coma

From: Eik Vettorazzi <E.Vettorazzi_at_uke.uni-hamburg.de>
Date: Tue, 18 Mar 2008 10:57:29 +0100

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

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 18 Mar 2008 - 10:01:03 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 18 Mar 2008 - 11:30:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive