开发者

cannot import data from R to SPSS

开发者 https://www.devze.com 2023-02-07 08:47 出处:网络
I used the write.foreign command from the foreign library to import R data to SPSS, I have used the following code but fail:

I used the write.foreign command from the foreign library to import R data to SPSS, I have used the following code but fail:

write.foreign(esoph,"esoph.dat","esoph.sps",package="SPSS")

But 开发者_如何学编程when I try to run the esoph.sps file in SPSS, the output gives me the following message is SPSS output:

DATA LIST FILE= "esoph.dat"  free (",") 
/ agegp alcgp tobgp ncases ncontrls  . 

>Error # 31 in column 17.  Text: esoph.dat 
>File not found. 
>This command not executed. 
VARIABLE LABELS

Can anyone tell me what happen? Thanks.


The file is probably not in the SPSS working directory. With show directory. SPSS shows the current working directory. Try editing the .sps file to include the full path in the FILE="esoph.dat" statement. Alternatively, try putting the .dat and .sps files in the working directory.

0

精彩评论

暂无评论...
验证码 换一张
取 消