Hello, I have a problem to read a csv table. To read it I used this syntax> donParCara <- read.table("C:/Documents and Settings/melyakhlifi/Mes documents/feuilles excel/calcul2.csv",header=TRUE,sep=";",quote="",dec=",")I don't understand my errors Erreur dans scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : la ligne 16 n'avait pas 21 éléments Can you help me please? _____________________________________________________________________________ Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail [[alternative HTML version deleted]]
Why are you not using read.csv or read.csv2 when you are reading a csv file? -------- Original Message -------- Subject: [R] to read table From: elyakhlifi mustapha <elyakhlifi_mustapha at yahoo.fr> To: R-help at stat.math.ethz.ch Date: 18.06.2007 09:23> Hello, > I have a problem to read a csv table. To read it I used this syntax > > >> donParCara <- read.table("C:/Documents and Settings/melyakhlifi/Mes documents/feuilles excel/calcul2.csv",header=TRUE,sep=";",quote="",dec=",") >> > > I don't understand my errors > > Erreur dans scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : > la ligne 16 n'avait pas 21 ?l?ments > > Can you help me please? > >
That means that R doesn't see 21 elements in line 16 of your file. This can happen if one of your entries consists of two words, which are then read as two elements. Katharina elyakhlifi mustapha schrieb:> Hello, > I have a problem to read a csv table. To read it I used this syntax > > >> donParCara <- read.table("C:/Documents and Settings/melyakhlifi/Mes documents/feuilles excel/calcul2.csv",header=TRUE,sep=";",quote="",dec=",") >> > > I don't understand my errors > > Erreur dans scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : > la ligne 16 n'avait pas 21 ?l?ments > > Can you help me please? > > > _____________________________________________________________________________ > Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail > [[alternative HTML version deleted]] > > > ------------------------------------------------------------------------ > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >