honza at ifolk.cz
2007-Sep-05 09:25 UTC
[Rd] (PR#9896) read.spss converts string variables with
------=_20070905112441_38848 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 8bit I am sending two files attached. The file problem_file.sav was saved in SPSS 10.0. It contains variables of various types, with and without labeling etc., so that you can make experiments. The file problem_file_read.RData was saved in R 2.5.1 (foreign library version 0.8-20). It contains two data frames Schools and Schools2. The former is result of read.spss("problem_file.sav",to.data.frame=TRUE,use.value.labels=TRUE), the latter differs in use.value.lables=FALSE only. As you can see, in the first case read.spss has not read values of string labeled variables at all. I use WinXP. Thank you for your work! Jan Hucin ------------------------------------------------------------------- Reference: <20070903104656.1D1566691D at slim.kubism.ku.dk> There is nothing we can do to reproduce this without an example 'some.sav' file exhibiting the problem. Can you please supply one? On Mon, 3 Sep 2007, honza at ifolk.cz wrote:> Full_Name: Jan Hucin > Version: 2.5.1 (foreign 0.8-20) > OS: WinXP > Submission from: (NULL) (195.113.83.7) > > > When reading an SPSS file: > > - containing some variable of type String > - with value labels at that variable > - and with determination which values of that variable are considered to be > missing, > > I have always get <NA> where digits were in the original SPSS file. > > Example: > Let's have in an SPSS file "some.sav" the variable A. The type of thevariable> is String of length 1. > Let's have a value labeling: 1 = Yes, 2 = No, 8 = Invalid, 9 = Missing. > Let's determine that value 9 is considered to be missing. > When this file is read byabc=read.spss("some.sav",use.value.labels=TRUE), we> get <NA> in abc$A on places where "1", "2" etc. were. Surprisingly, weget "N/A"> (not <NA>!) on the place where the string "N/A" is. > > If we specify use.value.labels=FALSE, then we get string values (such as"1",> "2") but we lose value labels (Yes, No etc.). > > Let me add that if the variable in the original SPSS file was of typeNumeric> (not String), there would be no problem. > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 __________ Informace od NOD32 2505 (20070904) __________ Tato zprava byla proverena antivirovym systemem NOD32. http://www.nod32.cz ------=_20070905112441_38848 Content-Type: application/octet-stream; name="problem_file.sav" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="problem_file.sav" JEZMMkAoIykgU1BTUyBEQVRBIEZJTEUgTVMgV2luZG93cyBSZWxlYXNlIDEwLjAuNSBzcHNzaW8z Mi5kbGwgIAIAAAAYAAAAAQAAAAAAAAAKAAAAAAAAAAAAWUAwNSBTZXAgMDcxMTowOTo0NyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAAAAACAAAAAwAAAAEAAAAAAAAAAAMBAAADAQBDTlQgICAgIBgAAABDb3VudHJ5IGNvZGUgMy1j aGFyYWN0ZXICAAAAAwAAAAEAAAAAAAAAAAMBAAADAQBDT1VOVFJZIBQAAABDb3VudHJ5IGNvZGUg My1kaWdpdAIAAAAFAAAAAQAAAAAAAAAABQEAAAUBAFNDSE9PTElEEQAAAFNjaG9vbCBJRCA1LWRp Z2l0ICAgAgAAAAAAAAABAAAAAwAAAAAFBQAABQUAU0MwMVEwMSASAAAATnVtYmVyIG9mIGJveXMg UTFhICAAAAAAgIbDQAAAAAAAh8NAAAAAAICHw0ACAAAAAQAAAAEAAAADAAAAAAEBAAABAQBTQzAy UTAxIBQAAABQdWJsaWMgb3IgcHJpdmF0ZSBRMjcgICAgICAgOCAgICAgICA5ICAgICAgIAIAAAAB AAAAAQAAAAMAAAAAAQEAAAEBAFNDMDRRMDEgCwAAAEdyYWRlIDEgUTRhIDcgICAgICAgOCAgICAg ICA5ICAgICAgIAIAAAABAAAAAQAAAAMAAAAAAQEAAAEBAFNDMDRRMDIgCwAAAEdyYWRlIDIgUTRi IDcgICAgICAgOCAgICAgICA5ICAgICAgIAIAAAABAAAAAQAAAAMAAAAAAQEAAAEBAFNDMDRRMDMg CwAAAE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RVNUICAgICAH RXN0b25pYUZJTiAgICAgB0ZpbmxhbmRGUkEgICAgIAZGcmFuY2UgR0JSICAgICAOVW5pdGVkIEtp bmdkb20gR1JDICAgICAGR3JlZWNlIEhLRyAgICAgD0hvbmcgS29uZy1DaGluYUhSViAgICAgB0Ny b2F0aWFIVU4gICAgIAdIdW5nYXJ5SUROICAgICAJSW5kb25lc2lhICAgICAgSVJMICAgICAHSXJl bGFuZElTTCAgICAgB0ljZWxhbmRJU1IgICAgIAZJc3JhZWwgSVRBICAgICAFSXRhbHkgIEpPUiAg ICAgBkpvcmRhbiBKUE4gICAgIAVKYXBhbiAgS0daICAgICAKS3lyZ3l6c3RhbiAgICAgS09SICAg ICAFS29yZWEgIExJRSAgICAgDUxpZWNodGVuc3RlaW4gIExUVSAgICAgCUxpdGh1YW5pYSAgICAg IExVWCAgICAgCkx1eGVtYm91cmcgICAgIExWQSAgICAgBkxhdHZpYSBNQUMgICAgIAtNYWNhby1D aGluYSAgICBNRVggICAgIAZNZXhpY28gTU5FICAgICAKTW9udGVuZWdybyAgICAgTkxEICAgICAL TmV0aGVybGFuZHMgICAgTk9SICAgICAGTm9yd2F5IE5aTCAgICAgC05ldyBaZWFsYW5kICAgIFBP TCAgICAgBlBvbGFuZCBQUlQgICAgIAhQb3J0dWdhbCAgICAgICBRQVQgICAgIAVRYXRhciAgUk9V ICAgICAHUm9tYW5pYVJVUyAgICAgElJ1c3NpYW4gRmVkZXJhdGlvbiAgICAgU1JCICAgICAJU2Vy YmlhICAgICAgICAgU1ZLICAgICAPU2xvdmFrIFJlcHVibGljU1ZOICAgICAJU2xvdmVuaWEgICAg ICAgU1dFICAgICAGU3dlZGVuIFRBUCAgICAgDkNoaW5lc2UgVGFpcGVpIFRIQSAgICAgCFRoYWls YW5kICAgICAgIFRVTiAgICAgB1R1bmlzaWFUVVIgICAgIAZUdXJrZXkgVVJZICAgICAHVXJ1Z3Vh eVVTQSAgICAgDVVuaXRlZCBTdGF0ZXMgIAQAAAABA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AgICAgAAAAAAAAHEADTi9BICAgIAAAAAAA ACJAB01pc3NpbmcEAAAAAQAAABUAAAADAAAAAgAAAAAAAAAAQFhAA04vQSAgICAAAAAAAMBYQARN aXNzICAgBAAAAAEAAAAWAAAAAwAAAAYAAAAAAAAAAADwPxNQcml2YXRlIGluZGVwZW5kZW50ICAg IAAAAAAAAABAHFByaXZhdGUgZ292ZXJubWVudC1kZXBlbmRlbnQgICAAAAAAAAAIQAZQdWJsaWMg AAAAAAAAHEADTi9BICAgIAAAAAAAACBAB0ludmFsaWQAAAAAAAAiQAdNaXNzaW5nBAAAAAEAAAAY AAAABwAAAAMAAAAEAAAACAAAAAoAAAAAAAAABQAAANACAAABAAAAAQAAAAIAAAACAAAABwAAAAQA AAAIAAAAAwAAAP///////+//////////73/+///////v/wcAAAALAAAABAAAAEgAAAABAAAABQAA AAAAAAABAAAABwAAAAAAAAABAAAACAAAAAAAAAADAAAABwAAAAEAAAABAAAABwAAAAAAAAABAAAA BwAAAAAAAAABAAAABwAAAAAAAAABAAAABwAAAAAAAAABAAAABwAAAAAAAAABAAAABwAAAAAAAAAB AAAABwAAAAAAAAABAAAABwAAAAAAAAABAAAABwAAAAAAAAABAAAABwAAAAAAAAABAAAABwAAAAAA AAABAAAABwAAAAAAAAABAAAABwAAAAAAAAABAAAABwAAAAAAAAADAAAACwAAAAEAAAADAAAACwAA AAEAAAACAAAABwAAAAEAAAADAAAABgAAAAEAAAADAAAACwAAAAEAAAACAAAACAAAAAEAAAAHAAAA DQAAAAEAAACDCwAAQ05UPUNOVAlDT1VOVFJZPUNPVU5UUlkJU1VCTkFUPVN1Yk5hdAlTQ0hPT0xJ RD1TQ0hPT0xJRAlTQzAxUTAxPVNDMDFRMDEJU0MwMVEwMj1TQzAxUTAyCVNDMDJRMDE9U0MwMlEw MQlTQzAzUTAxPVNDMDNRMDEJU0MwM1EwMj1TQzAzUTAyCVNDMDNRMDM9U0MwM1EwMwlTQzAzUTA0 PVNDMDNRMDQJU0MwNFE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gAAAAAACQc0AxICAg ICAgIDEgICAgICAgMSAgICAgICAxICAgICAgIP39/f39/f39MSAgICAgICAxICAgICAgIDEgICAg ICAgMSAgICAgICAxICAgICAgIDEgICAgICAgMiAgICAgICAyICAgICAgIP39ZP1me2VnMiAgICAg ICAyICAgICAgIAAAAAAAII9A/f39/f39/f1DWkUgICAgIDIwMyAgICAgMDIwMDQgICAAAAAAAKBt QDEgICAgICAgMSAgICAgICAxICAgICAgIDEgICAgICAg/f39/f39/f0xICAgICAgIDEgICAgICAg MSAgICAgICAxICAgICAgIDEgICAgICAgMSAgICAgICAyICAgICAgIDIgICAgICAg/f1l/WZ2ZWcy ICAgICAgIDIgICAgICAgAAAAAAAgj0D9/f39/f39/UNaRSAgICAgMjAzICAgICAwMjMwMyAgIAAA AAAAIG5AMSAgICAgICAxICAgICAgIDEgICAgICAgMSAgICAgICD9/f39/f39/TEgICAgICAgMSAg ICAgICAxICAgICAgIDEgICAgICAgMSAgICAgICAxICAgICAgIDIgICAgICAgMiAgICAgICD9/f39 ZoBlZzIgICAgICAgMiAgICAgICCamZmZmZnpPwAAAAAAII9A/f39/f39/f1DWkUgICAgIDIwMyAg ICAgMDIzMDUgICAAAAAAgIfDQDkgICAgICAgOSAgICAgICA5ICAgICAgIDkgICAgICAg/f39/f39 /f05ICAgICAgIDkgICAgICAgOSAgICAgICA5ICAgICAgIDkgICAgICAgOSAgICAgICA5ICAgICAg IDkgICAgICAg/f39/W3H/W05ICAgICAgIDkgICAgICAgAAAAAICHw0AAAAAAgIfDQAAAAACAh8NA /f39/f39/f1DWkUgICAgIDIwMyAgICAgMDMzMDEgICAAAAAAACBnQDEgICAgICAgMSAgICAgICAx ICAgICAgIDEgICAgICAg/f39/f39/f0xICAgICAgIDEgICAgICAgMSAgICAgICAxICAgICAgIDEg ICAgICAgMSAgICAgICAyICAgICAgIDIgICAgICAg/f1k/WaA/WcyICAgICAgIDIgICAgICAgAAAA AAAgj0Boke18PzXuP/39/dn9/f39Q1pFICAgICAyMDMgICAgIDAzMzAyICAgMSAgICAgICAxICAg ICAgIDEgICAgICAgMSAgICAgICD9/f39/f39/TEgICAgICAgMSAgICAgICAxICAgICAgIDEgICAg ICAgMSAgICAgICAxICAgICAgIDIgICAgICAgMiAgICAgICD9/WT9Znv9ZzIgICAgICAgMiAgICAg ICAAAAAAACCPQPCnxks3ie0//f39/f39/f1DWkUgICAgIDIwMyAgICAgMDQwMDIgICAAAAAAABB1 QDEgICAgICAgMSAgICAgICAxICAgICAgIDEgICAgICAg/f39/f39/f0xICAgICAgIDEgICAgICAg MSAgICAgICAxICAgICAgIDEgICAgICAgMSAgICAgICAyICAgICAgIDIgICAgICAg/f1k/Wd7/Wcy ICAgICAgIDIgICAgICAgAAAAAAAgj0DByqFFtvPVP/39/f39/f39Q1pFICAgICAyMDMgICAgIDA0 MzAxICAgAAAAAADgd0AxICAgICAgIDEgICAgICAgMSAgICAgICAxICAgICAgIP39/f39/f39MSAg ICAgICAxICAgICAgIDEgICAgICAgMSAgICAgICAxICAgICAgIDEgICAgICAgMiAgICAgICAyICAg ICAgIP39/f1mgGVnMiAgICAgICAyICAgICAgIJqZmZmZmek/AAAAAAAgj0A------=_20070905112441_38848 Content-Type: application/octet-stream; name="problem_file_read.RData" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="problem_file_read.RData" H4sIAAAAAAAAC+0ZuW4bR3RFitRly/JRqDCCgSunsE1RN2BYB3WY1i1KiGwgxZAcLcdazjCzu6Il pHAVI1WSMqmSKn+Q2oGBFOnTp03hwECAlFZmxH3LnSVp6vCFYAksZ9+bmXfNe29m3m7O7aR7d3oN w4gZsUSHEYvL186Y/OswjIEe2XblCiXOLdsw4lclOCjbi7LtfSr/TvKEyCUtsk8UNWNAPpPyUdie GWES5lCGfYRrOwJbFBBdxwgf7J05JCKP6WPMYMAssUzqlj2we9a1TFyfkJwV+JBaAGUww0Xo68tV qSPpWZgVPVQiU6IWAVoZbvFy3qfVnzkkhRLaJBU3b9ECCLBIRBm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erl1+NLv/38 auqPf36Z/+n3X2FcSMw2NwZf3LNfErzJ4SfZiNMcJumRvOpdCxBlRVIh8o85Xtd16DLlnVmwsuy5 FR6j3zHeTiBohhkE0pnVLaCVWdte3dp86IHducz9tbXl7Bx05zKpoQ3/wqnAtA6ONIBpHRzWwREd HNXBMR0c18EJHZzUwKGUDupSDelSDQWlGtVVGA2oMDO7uLm2vQ6WzSznso/m66ZbWf9sfjZguuWt h+vzoftrj+DV23CHVV4WUz57dHT0b4v16y1iB9/eFXJKiNSlfVXsy1uBm3RwWQcz3GWOOEAFXiRo +FahhIV0BQIFn2uh/iI1Kfje5dpXEpSdQ6Nax5VVt5wnAvFdlOcHNtoYghLNtZq7IpnvKp5zb4Dh +hYFljyG0MYI1lFpicrrqGGJKuioEYkq6qhRiSI6akyidnXUuESZOmpCoko6alKiqIe64ImakrjH IZySfy+EUwpYIZzSAKpSn2zKsMYOumuqvntIvWZzmfm59D20MYrbjRpWo8BAizN5alHnAJmCuxUZ 8qhKnRJlyK5900KCqLUsol3By0j67oR0ZVXr8t7T6GY6lRr71COXztFDolbyrkNsB1mYmS42Jffj cngDsbF6XNxcF7zChSoKqvkFXq640rFs+caY3OXkLIejKgHBBzx34lUmR5VoJcpEHyQTwfampZFu 74toOvxJ1Gh+imvyaNsfJK545tH8uY+MJ2aWVusZ1XDfdQ33/Z6+mnlArI1HwOm0A0zaMXluL4x4 RjwjnhHPM/FMRzw/Ep61jdFo8fPLEn99r34/wAbXcrw3LrQxdrbaGKe/Qd5MbYOEoteJNsjGvdLb 7D3abVuQrc24j0Knbs/OUCYyWrQ3WuC7dTikU8Kfd735eL3s5OsG5cCQbgFlWtX8WhYJW1UWdXNE RT/j3R47dbdr29442biQAkl/HvLa07kfFBdPHFp6GfEkhccWdcvA3TG6uH+AEmJSGf1MFcOuo6g0 GJUGo9JglGHalwaN1/8BQ7FK8UQxAAA------=_20070905112441_38848--
Prof Brian Ripley
2007-Sep-05 17:01 UTC
[Rd] (PR#9896) read.spss converts string variables with
Thank you. If anyone wants to work on a patch I've put the unencoded files from my direct copy at http://www.stats.ox.ac.uk/pub/bdr/problem_file.sav http://www.stats.ox.ac.uk/pub/bdr/problem_file_read.RData I am afraid I won't have a chance to take a look for at least a couple of weeks. On Wed, 5 Sep 2007, honza at ifolk.cz wrote:> ------=_20070905112441_38848 > Content-Type: text/plain; charset="iso-8859-2" > Content-Transfer-Encoding: 8bit > > I am sending two files attached. The file problem_file.sav was saved in > SPSS 10.0. It contains variables of various types, with and without > labeling etc., so that you can make experiments. > > The file problem_file_read.RData was saved in R 2.5.1 (foreign library > version 0.8-20). It contains two data frames Schools and Schools2. The > former is result of > read.spss("problem_file.sav",to.data.frame=TRUE,use.value.labels=TRUE), > the latter differs in use.value.lables=FALSE only. As you can see, in the > first case read.spss has not read values of string labeled variables at > all. > > I use WinXP. > > Thank you for your work! > > Jan Hucin > > ------------------------------------------------------------------- > Reference: <20070903104656.1D1566691D at slim.kubism.ku.dk> > > There is nothing we can do to reproduce this without an example 'some.sav' > file exhibiting the problem. Can you please supply one? > > On Mon, 3 Sep 2007, honza at ifolk.cz wrote: > >> Full_Name: Jan Hucin >> Version: 2.5.1 (foreign 0.8-20) >> OS: WinXP >> Submission from: (NULL) (195.113.83.7) >> >> >> When reading an SPSS file: >> >> - containing some variable of type String >> - with value labels at that variable >> - and with determination which values of that variable are considered to be >> missing, >> >> I have always get <NA> where digits were in the original SPSS file. >> >> Example: >> Let's have in an SPSS file "some.sav" the variable A. The type of the > variable >> is String of length 1. >> Let's have a value labeling: 1 = Yes, 2 = No, 8 = Invalid, 9 = Missing. >> Let's determine that value 9 is considered to be missing. >> When this file is read by > abc=read.spss("some.sav",use.value.labels=TRUE), we >> get <NA> in abc$A on places where "1", "2" etc. were. Surprisingly, we > get "N/A" >> (not <NA>!) on the place where the string "N/A" is. >> >> If we specify use.value.labels=FALSE, then we get string values (such as > "1", >> "2") but we lose value labels (Yes, No etc.). >> >> Let me add that if the variable in the original SPSS file was of type > Numeric >> (not String), there would be no problem. >> >> ______________________________________________ >> R-devel at r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >> > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595