Hello When trying to read a table from excel, the generated error message is not documented in the "R data import" document: > v2 <- read.table("v2-101-405-excel.txt", header=T,row.names=0) Error in read.table("v2-101-405-excel.txt", header = T, row.names = 0) : attempt to select less than one element How do I proceed to resolve this problem? thanks Lars Here are the first three out of around 500 rows in the file (missing data in Target.RESP col is marked as NA): Subject Sex Age Gruppe Type Target.CRESP Target.RESP Target.RT Prime.OnsetTime Target.OnsetTime Ordning Ident 101 female 22 7 t 0 0 1520 155074 158497 101 145 101 female 22 9 o 0 1 3020 161678 166005 102 160
Hello Lars, from the read.table documentation: row.names: a vector of row names. This can be a vector giving the actual row names, or a single number giving the column of the table which contains the row names, or character string giving the name of the table column containing the row names. Column numbering in R starts at 1 but you tell read.table to use the 0th column - this is consitent with your error message. The folowing works for me:> x <- read.table("bla", header=T) > xSubject Sex Age Gruppe Type Target.CRESP Target.RESP Target.RT 1 101 female 22 7 t 0 0 1520 2 101 female 22 9 o 0 1 3020 Prime.OnsetTime Target.OnsetTime Ordning Ident 1 155074 158497 101 145 2 161678 166005 102 160 -Marc -- =======================================================Dipl. Inform. Med. Marc Kirchner Interdisciplinary Centre for Scientific Computing (IWR) Multidimensional Image Processing INF 368 University of Heidelberg D-69120 Heidelberg Tel: ++49-6221-54 87 97 Fax: ++49-6221-54 88 50 marc.kirchner at iwr.uni-heidelberg.de -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : https://stat.ethz.ch/pipermail/r-help/attachments/20051101/7d8e40a2/attachment.bin