Re: [R] read.spss and umlaut

From: Thomas Kuster <r_at_fam-kuster.ch>
Date: Fri 04 Aug 2006 - 16:20:11 EST

Hello

Am Donnerstag, 3. August 2006 15.34 schrieb Thomas Lumley:
> On Thu, 3 Aug 2006, Thomas Kuster wrote:
> > Hello
> >
> > Am Mittwoch, 2. August 2006 17.11 schrieb Thomas Lumley:
...
> You haven't shown anything that indicates that the C code stopped reading.
> More likely R just stops displaying when it gets to an illegal byte
> sequence. You could use nchar() to count the bytes in the string to find
> out.

If I change the translatable characters (overwrite the 0 between :#@'=" and ~000 with ). I can read in the file an every ist a withspace:
> daten <- read.spss("projets_umlaut.por")
> levels(daten$PROJETX)

  [1] "Bg Stammzellenforschung"
  [2] "Bb   ber eine neue Finanzordnung"
  [3] "Bb Neugestaltung des Finanzausgleichs"
  [4] " nderrung Bg  EOG Mutterschafturlaub"
  [5] "EV Postdienste f r alle"
  [6] "Bb  ber B rgerrechtserwerb 3. Generation"
  [7] "Bb  ber erleichterte Einb rung 2. Generation"
  [8] "Bg Steuerpaket"
   .

   .
   .
> levels(daten$PROJETX)[208]

[1] "EV Gleiche Rechte f r Mann und Frau Gegenvorschlag"
> charToRaw(levels(daten$PROJETX)[208])
 [1] 45 56 20 47 6c 65 69 63 68 65 20 52 65 63 68 74 65 20 66 20 72 20 4d 61 6e
[26] 6e 20 75 6e 64 20 46 72 61 75 20 47 65 67 65 6e 76 6f 72 73 63 68 6c 61 67

without change the table I get:
> daten <- read.spss("projets.por")
> charToRaw(levels(daten$PROJETX)[208])
 [1] 45 56 20 47 6c 65 69 63 68 65 20 52 65 63 68 74 65 20 66

The SPSS file is from:
http://voxit.sidos.ch/update.asp?lang=d
-> Download der kumulierten Dateien Version 2.0

You must accept this:
The Standardized Post-Vote Surveys:
http://voxit.sidos.ch/agreement.asp?lang=e&menu=0

Thomas



R-help@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. Received on Fri Aug 04 16:27:26 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 05 Aug 2006 - 02:18:12 EST.

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