R引入其他统计软件数据的扩…

来源:互联网 发布:mac进入屏保快捷键 编辑:程序博客网 时间:2024/06/07 17:58
原文地址:R引入其他统计软件数据的扩展包是foreign作者:生物统计



R引入其他统计软件数据的扩展包是foreign,

在主窗口命令提示符下键入“library(foreign)”后,R软件载入“foreign”模块,

可以读入Minitab, S, SAS, SPSS, Stata, Systat, dBase等软件相应格式的数据:
读入epi5~6的数据命令为read.epiinfo(“文件名.rec”);
读入Stata5~10数据命令为read.dta(“文件名.dta”);
对于SAS,R只能读入SAS Transportformat(XPORT)文件,

因此需要将常规的SAS数据文件(.ssd和.sas7bdat)转换为Transportformat(XPORT)文件,再用命令read.xport( )读入,需注意:

1.采用stattransfer软件转化

2.import and put it into the same folderas your R working directory,

In order to check what your R working directory is type:
> getwd()

If the directory it returns is not the directory you would liketo use, then simply use the following function to set your workingdirectory:

> setwd()

一定要把文件 into the same folder as your Rworking directory

 

 


读入SPSS数据文件命令为read.spss();读入.DBF格式文件命令为read.dbf();读入Systat软件.syd格式数据文件命令为read.systat();
读入Minitab数据命令为read.mtp()。

原创粉丝点击