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.
精彩评论