R Export Data - gizotso/R GitHub Wiki

write.table()

write.table(x, file = "", append = FALSE, quote = TRUE, sep = " ",
           eol = "\n", na = "NA", dec = ".", row.names = TRUE,
           col.names = TRUE, qmethod = c("escape", "double"))

write(x, file="data.txt")

write.table() write.table(x, file = "foo.csv", sep = ",", col.names = NA, qmethod = "double")

Using .Rdata

  • save(x, y, z, file="xyz.RData") #option ascii=TRUE : saves specified datasets to a datafile .Rdata.

  • load("xyz.RData") : load a dataset written with save

  • save.image <=> save(list=ls (all=TRUE), file=".RData")

  • save.image(file) : saves all objects in specified datafile