使用R中的foreign包可以较方便地读取其他统计软件的数据文件,比如SPSS、SAS等数据文件等
函数 | 描述 |
---|---|
read.arff | 从ARFF文件中读取文件,著名的数据挖掘开源软件weka的数据就是这种格式 |
read.dbf | 读取DBF文件,DBF文件就是数据库文件 |
read.dta | 读取Stata中的数据集 |
read.epiinfo | 读取Epi Info的数据集 |
read.mtp | 读取Minitab中的数据集 |
read.octave | 读取Octave的文本数据 |
read.spss | 读取SPSS的数据文件 |
read.ssd | 读取SAS的永久数据集 |
read.systat | 读取systat格式的数据 |
导入其他统计软件文件-foreign包
foreign包中常用读取其他格式文件的函数
统计软件 | 读取数据的函数格式 |
---|---|
SPSS | read.spss(file,to.data.frame=TRUE |
SAS | read.ssd(libname,sectionnames,tmpXport=tempfile(),tmpProgLoc=tempfile(),sascmd=“sas”) |
Minitab | read.mtp(file) |
STATA | read.dta(file,convert.dates=TRUE,convert.factors=TRUE,missing.type=FALSE,convert.underscore=FALSE,warm.missing,labels=TRUE |
SYSTAT | read.systat(file,to.data.frame=TRUE) |
导入SPSS软件文件
通过foreign包中的read.spss()函数导入到R中
▲使用Hmisc包中的spss.get()函数导入
SAS程序:
R语言:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!