[R] Problems with foreign

José Oscar Delgado Bautista jodb2003 @end|ng |rom gm@||@com
Thu Mar 30 19:36:57 CEST 2023


 Good day
My name is José Oscar, I'm from Mexico and I have some questions about
foreign in your write.foreig( ) function. We know that this function
generates the inputs to be able to run them or execute them in another
program like SPSS, SAS or Stata. In these cases, when creating an example
file, a matrix and using the function to execute the .sps file directly
from SPSS, I don't care or work based on the SPSS environment. With Stata
the problem does not arise, but this same problem also arises with SAS, in
that sense or question, how could I solve this? Do you have any guides or
tutorials on the correct use of the function?

This is the code:
x<- matrix(data = sample(1:100,
                         100),
           nrow = 10, ncol = 10)

x2<- as.data.frame(x)

write.foreign(x2, "x2_spss.txt", "x2_spss.sps", package = "SPSS")

	[[alternative HTML version deleted]]



More information about the R-help mailing list