[R] Export Created Variables to SPSS/.csv

David Winsemius dwinsemius at comcast.net
Tue Mar 27 00:01:08 CEST 2012


On Mar 26, 2012, at 1:59 PM, Strassburger, Daniel wrote:

> I haven't been successful in converting my colleagues to the world  
> of R yet they wish to share collected data so that they may analyze  
> it in SPSS.
>
> I know how to write to an SPSS file and it opens fine, but my  
> problem is that it only includes the existing data - none of the  
> variables I created within R.
>
> The procedure followed thus far:
>
>
> 1.       Collect Data via online system
>
> 2.       Online system provides .csv of collected data
>
> 3.       Read .csv into R
>
> 4.       Analyze data/create variables associated with analyses  
> within R
>
> Now I want to know if there is a way to export the variables I've  
> created within R into an SPSS-usable file.

Isn't SPSS able to read either CSV or one of the several formats  
supported by functions in package 'foreign'?

?write.foreign

Usage
write.foreign(df, datafile, codefile, package = c("SPSS", "Stata",  
"SAS"), ...)
-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list