各位大侠,我用Proc IML调用R的时候,出现下面的问题,如何解决呢? 换一台电脑跑同样的程序,是没有报错的
proc options option=rlang;
2 run;
SAS (r) Proprietary Software Release 9.4 TS1M4
RLANG Enables SAS to execute R language statements.
NOTE: PROCEDURE OPTIONS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
3
4 option set=R_HOME='C:\Program Files\R\R-4.0.2';
5
6 proc iml;
NOTE: Writing HTML Body file: sashtml.htm
NOTE: IML Ready
7 /* Comparison of matrix operations in IML and R */
8 print "---------- SAS/IML Results -----------------";
9 x = 1:3;
9 ! /* vector of sequence 1,2,3 */
10 m = {1 2 3, 4 5 6, 7 8 9};
10 ! /* 3 x 3 matrix */
11 q = m * t(x);
11 ! /* matrix multiplication */
12 print q;
13 print "------------- R Results --------------------";
14 submit / R;
15 rx <- matrix( 1:3, nrow=1) # vector of sequence 1,2,3
16 rm <- matrix( 1:9, nrow=3, byrow=TRUE) # 3 x 3 matrix
17 rq <- rm %*% t(rx) # matrix multiplication
18 print(rq)
19 endsubmit;
ERROR: SAS is unable to transcode character data to the R encoding.
ERROR: The final R statement is incomplete.
ERROR: The final R statement is incomplete.
ERROR: The final R statement is incomplete.
ERROR: The final R statement is incomplete.
statement : SUBMIT at line 14 column 1
20
21 quit;