I would like to know how do I export a generated data table within R to txt
or csv
format?
I would like to know how do I export a generated data table within R to txt
or csv
format?
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)