2011年8月24日 星期三

如何在R中讀取SPSS資料檔

1. 記得載入foreign這個程式套件
2. 使用: read.spss這個函數(http://stat.ethz.ch/R-manual/R-devel/library/foreign/html/read.spss.html)

例如我要打開存在F槽下的sleep.sav檔, 我就先載入foreign套件後, 再打入
read.spss("f:/sleep.sav")

也可以利用R commander中的data--> import data
更方便好用,且也不必再指定dataset的名字
它會先問你


沒有留言: