Importing SPSS data into R

53 views
Skip to first unread message

Ariel Tikotsky

unread,
Mar 21, 2017, 2:08:24 PM3/21/17
to Israel R User Group
Hi all,

I'm trying to import SPSS data into R, but Hebrew characters end up as NA using one method, and an error using a second method.

library (foreign)
library(memisc)


dataset1 = read.spss("C:\\PathToFile\\16199.sav", to.data.frame=TRUE, reencode='utf-8')   # tried both with and w/o the reencode
# Hebrew characters end up as NA

dataset2 = spss.portable.file("16199.por")                                  # por is the portable SPSS format; 
# this gives the following error message:
# Error in parseHeaderPorStream(ptr) : 
# unknown tag "6" found in line 7 offset 38

Tried changing the locale to Hebrew (using Sys.setlocale("LC_ALL", "Hebrew"))  - doesn't help...
any advice would be highly appreciated!
Ariel

amit gal

unread,
Mar 21, 2017, 2:38:00 PM3/21/17
to israel-r-...@googlegroups.com
לא שאני מבין את מקור הבעיה, אבל הייתי מנסה גם את הפונקציה read_spss של חבילת haven


--
You received this message because you are subscribed to the Google Groups "Israel R User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to israel-r-user-group+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ariel Tikotsky

unread,
Mar 21, 2017, 3:58:16 PM3/21/17
to Israel R User Group
 תודה, עמית! הצליח

Jonathan Rosenblatt

unread,
Mar 22, 2017, 7:08:07 AM3/22/17
to israel-r-user-group
פעם אחרי פעם הנושא של R ועברית עולה.
אם יש איזושהי הצדקה לקיום של הקהילה שלנו, זה לפחות כמוקד ידע לנושא זה.
מתי מישהו ירים את הכפפה ויכתוב מדריך בנושא?



To unsubscribe from this group and stop receiving emails from it, send an email to israel-r-user-group+unsubscribe...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Israel R User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to israel-r-user-group+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--
Jonathan Rosenblatt
Dept. of Industrial Engineering and Management
Ben Gurion University of the Negev

Reply all
Reply to author
Forward
0 new messages