Hello, at the moment i am using spss as my favorite statistics package, but R seems an atractive alternative. Thanks to the R-Team for their great work! (I use R on my windows98 laptop,P II and 64MB Ram). I have a big(?) data set, containing more than 470 variables and 3200 cases (size: 2.5MB). Whenever I use the command 'read.spss' (foreign-library), I got the the following warning massages: ------------------ Warning messages: 1: d:/s3000.sav: File contains duplicate label for value 0.5 for variable V50. 2: d:/s3000.sav: File contains duplicate label for value 1 for variable V50. 3: d:/s3000.sav: File contains duplicate label for value 0.5 for variable V63. 4: d:/s3000.sav: File contains duplicate label for value 1 for variable V63. [...] ------------------ How do I interpret these warnings? My next step was trying to save the spss-data as an ascii- file (separated by tabs) and using the R command 'read.table' -- R crashes. My third step was saving the spss-data as an ascii-file (in fixed format) and using again 'read.table'. I got: ------------------ Error in read.table("d:/fixed.dat", header = T) : all rows must have the same length. ------------------ What went wrong? TIA Bernd -- Bernd Wei? (bernd.weiss at epost.de) PGP Key ID: 0x4117206F PGP FP: 08B2 09CD 7192 526D 93FD 2070 53DB 7C4F 4117 206F www.pgpi.org -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Sat, Jun 09, 2001 at 03:57:29PM +0200, Bernd Weiss wrote:> Error in read.table("d:/fixed.dat", header = T) : > all rows must have the same length.Look at your exported data-file an you'll see how you have to read it. My standard way to read excel csv files is: Akten1998.1 <- read.csv("File.csv",sep=";",as.is=T,dec=",") But this depends on several cirumstances. E.g. on some windows platforms the "dec" is set to "." (I think you can set this with spss). Spss often uses tabs as seperators (depends how you export your file in spss) so sep="\t" should work. My experience with read.spss: 1. Works often with spss version 6-9... 2. ...mut sometimes crash with these files (I have at least one file that is not readable). 3. Don't work with spss version 10 files. Even spss 6 cannot read them. So: while (!success) exoport from spss with other options look at the file specify read.xxx parameter Peter -- P.Malewski, Limmerstr.47, 30451 Hannover, 0511-2135008 At work: http://www.MH-Hannover.de 0511 532 3194 / Fax: 0511 532 3190, P.Malewski at tu-bs.de, peter.malewski at gmx.de, malewski.peter at mh-hannover.de. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
The second problem is the result of all rows not having the same length. My version of R usually tells me the lengths of the rows. If yours doesn't, you might try read.table(your_data,echo="TRUE") which can be abbreviated as e="T". This can arise in many ways. One way has to do with the conversion of missing data. If the conversion to ascii substituted empty spaces or tabs for missing data, then these will not be counted in the length of the row. You may need to edit the ascii file, replacing __ (double space) with _NA_, for example. Some spreadsheet programs can help you do this, but you could also use an editor such as Emacs. In sum, the read.table() function really expects a table with all rows the same length. JOn -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi Jon, Peter, thanks for your immediate help. The command allbus<-read.table("d:/tab.dat",sep="\t",dec=",") works fine -- ok, I just took a part of the whole dataset. BTW: I use SPSS 10.0... so read.spss won't work. On 9 Jun 2001, at 12:43, Jonathan Baron wrote:> The second problem is the result of all rows not havingthe> same length. My version of R usually tells me the lengths > of the rows. If yours doesn't, you might try > read.table(your_data,echo="TRUE") which can be abbreviated > as e="T".That's curious. 'My' read.table doesn't know the echo- argument (I use r1.2.3, win32). Have a look at the results of ?read.table: read.table(file, header = FALSE, sep = "", quote = "\"'", dec = ".", row.names, col.names, as.is = FALSE, na.strings = "NA", skip = 0, check.names = TRUE, fill = FALSE, strip.white = FALSE, blank.lines.skip = TRUE) Thanks again for your help, Bernd -- Bernd Wei? (bernd.weiss at epost.de) PGP Key ID: 0x4117206F PGP FP: 08B2 09CD 7192 526D 93FD 2070 53DB 7C4F 4117 206F www.pgpi.org -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._