繁体   English   中英

我们如何通过R中的readLines读取SAS数据?

[英]How can we read SAS data through readLines in R?

readLInes读取SAS数据时出现错误

readLines("C:/Users/shahch07/Desktop/364978/MEAP/Nig/2015/Prelim/Input/akure_city_res_design.sas7bdat")

 [1] ""    ")0" ")0" ")"   ""    ""    ""    ""    ""    ""   
[11] ""    ""    ""   
There were 12 warnings (use warnings() to see them)

由于SAS使用压缩的二进制格式存储sas7bdat,因此您可能需要sas7dat软件包才能为您完成此操作

  • sas7bdat:read.sas7bdat()

注意,平台之间存在32/64的差异。

您可能需要使用专用的导入功能,例如:

f <- "C:/Users/shahch07/Desktop/364978/MEAP/Nig/2015/Prelim/Input/akure_city_res_design.sas7bdat"
haven::read_sas(f) # haven
rio::import(f)     # or, a more convenient wrapper around haven

使用install.packages(c("rio"))安装那些软件包。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM