[R] read.spss and umlaut

Thomas Kuster r at fam-kuster.ch
Fri Aug 4 08:20:11 CEST 2006


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



More information about the R-help mailing list