How do I export table in R in txt or csv?

6

I would like to know how do I export a generated data table within R to txt or csv format?

    
asked by anonymous 27.04.2015 / 17:11

1 answer

7

You can use the function write.csv or write.table ( documentation ), as in the example below.

nomes <- c("Scooby", "Salsicha", "Fred", "Velma", "Daphne")
idades <- c(10, 18, 20, 21, 19)
tabela <- data.frame(nome = nomes, idade = idades)
write.csv(tabela, "ScoobyDoo.csv", row.names = FALSE)
    
27.04.2015 / 17:40