加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

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

(2011-09-23 10:25:51)
分类: R程序



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 Transport format(XPORT)文件,

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

1.采用stattransfer软件转化

2.import and put it into the same folder as 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 like to use, then simply use the following function to set your working directory:

> setwd()

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

 

 


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

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有