全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
7403 14
2014-02-24
悬赏 100 个论坛币 未解决
我在sas调用R的时候碰到一系列问题,说是要rlang的方式启动R。其中一个说明是“To get access to R, SAS has to be started with the RLANG Option (C:\...\sas.exe -RLANG). ”。


这个具体怎么操作?有通知了解吗?谢谢

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2014-2-25 17:56:54
请问是SAS让R程序跑起来,R输出结果,SAS再去读结果。
还是sas直接获取R运行后的结果?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-2-27 08:39:20
1. 在SASV9.CFG 里添加 Rlang选项,如下:

  -Rlang

2. 启动SAS, 检查RLANG选项。
proc options option=rlang;
run;

3. 提交R代码。
proc iml;
  submit / R;
  rx <- matrix( 1:3, nrow=1) ;
  endsubmit;
quit;

不一定能成功。好像和R的版本有关。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-2-27 23:32:29
Rlang功能有License site限制,如果你安装的SAS9.3的License site允许你开放这个功能,请按带下步骤设置,看如下测试:
There are many things that R just does better. Hence, I am trying to set my system up so I can execute R commands from within

SAS using the [submit /R;] and [endsubmit;] commands. However I need some help getting my config files set up properly to do

this.

First Steps (to allow SAS to read the R language):
I checked to see if my system was set up to read the R language (code below).

proc options option=rlang;
run;
I got the following in my log:

SAS (r) Proprietary Software Release 9.3  TS1M0

NORLANG           Do not support access to R language interfaces
This meant I needed to add the -RLANG option to the config file. I did that. Below is an example of my config file (C:\Program

Files\SASHome\SASFoundation\9.3\sasv9.cfg):

-RLANG
-config "C:\Program Files\SASHome\SASFoundation\9.3\nls\en\sasv9.cfg"
(NOTE: the -RLANG had to be above the config reference for this to be recognized properly.)

And the resulting output in my log after re-opening enterprise guide and re-running the proc options code above:

SAS (r) Proprietary Software Release 9.3  TS1M0

RLANG             Support access to R language interfaces
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-2-28 00:12:37
你的问题已经解决,请按如下步骤检查和设置:

步骤:

1、运行如下程序,查看安装License site的限制:

    proc options restrict;
    run;

     SAS (R) PROPRIETARY SOFTWARE RELEASE 9.3  TS1M2


SAS 选项受您的软件安装点管理员限制
     您的软件安装点管理员尚未限定任何 SAS 选项。

NOTE: “PROCEDURE OPTIONS”所用时间(总处理时间):
      实际时间          0.00 秒
      CPU 时间          0.00 秒

结果,是无限制,说明可以设置Rlang。

2、打开(如果你用简本中文SAS):
C:\Program Files\SASHome\SASFoundation\9.3\nls\zh\sasv9.cfg
用记事本打开,在最前加一行:
-RLANG


3、然后运行:
proc options option=RLANG;  run;

结果如下:

1    proc options option=RLANG;
2    run;

     SAS (R) PROPRIETARY SOFTWARE RELEASE 9.3  TS1M2

RLANG             支持访问 R 语言接口
NOTE: “PROCEDURE OPTIONS”所用时间(总处理时间):
      实际时间          0.00 秒
      CPU 时间          0.00 秒

成功!!
注意:SAS9.3的Rlang功能,要求R版本:2.9.1或更高版本!
对如何使用,请参考我附上的附件!
附件列表

IML_Using R.pdf

大小:301.34 KB

 马上下载

SAS IML_using R

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-2-28 00:14:15
如果楼主,安装了R版本:2.9.1版本或更高,按照上述方法,和附件的说明和例子,可测试运行和学习。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群