There are numerous methods for exporting R objects into other formats . For SPSS, SAS and Stata, you will need to load the foreign packages. For Excel, you will need the xlsReadWrite package.
To A Tab Delimited Text File
write.table( mydata, "c:/mydata.txt" , sep= "\t" ) 제공
To an Excel Spreadsheet
library( xlsx)
write.xlsx( mydata, "c:/mydata.xlsx" ) 제공
(To work with R and Excel, try this interactive course on importing data in R.)
To SPSS
library( foreign)
write.foreign( mydata, "c:/mydata.txt" , "c:/mydata.sps" , package= "SPSS" ) 제공
(Alternatively, to practice importing SPSS data with the foreign package, try this exercise. )
To SAS
library( foreign)
write.foreign( mydata, "c:/mydata.txt" , "c:/mydata.sas" , package= "SAS" ) 제공
To Stata
library( foreign)
write.dta( mydata, "c:/mydata.dta" ) 제공
(Alternatively, to practice importing Stata data with the foreign package, try this exercise. )
There are numerous methods for exporting R objects into other formats . For SPSS, SAS and Stata, you will need to load the foreign packages. For Excel, you will need the xlsReadWrite package.
To A Tab Delimited Text File
To an Excel Spreadsheet
(To work with R and Excel, try this interactive course on importing data in R.)
To SPSS
(Alternatively, to practice importing SPSS data with the foreign package, try this exercise.)
To SAS
To Stata
(Alternatively, to practice importing Stata data with the foreign package, try this exercise.)