Exporting Data in R
- R-PROGRAMMING
There are multiple function are available in R to export data.
The following methods show how you can do it with syntax.
Method 1: Exporting as a Text File
write.table(data,"file.txt",sep="\t") Method 2: Exporting as a Excel File
library("writexl") write_xlsx(df,"file.xlsx") Method 3: Exporting as a CSV File
write.csv(data,"file.csv") Method 4: Exporting as a RDA File
save(data,file= "file.Rda") The following examples show how to export data in R, depending on file format.