开发者

cannot import data from R to SPSS

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜