[R] Save a generated .txt (or .csv) file on the desktop

varin sacha varinsacha at yahoo.fr
Mon Jan 30 21:26:21 CET 2017


Dear R-Experts,

I have generated a data.frame. Now I would like to get it (the generated data.frame) saved on my desktop (desktop of my computer) in a .csv or .txt file. How can I proceed ?

Many thanks.

Here is the reproducible example :



# Génération aléatoire des colonnes
Individu<-1:50
Genre<-sample(c("H","F"),50,replace=T)
Age<-sample(18:45,50,replace=T)
Pratique<-sample(c("PI","I","TI"),50,replace=T)
Statut<-sample(c("C","M","D"),50, replace=T)

# Génération du Data.frame "tableau" contenant les colonnes précédentes
tableau <- data.frame(Individu,Genre,Age,Pratique,Statut)

# Exportation du data.frame dans un fichier csv
write.csv(tableau,row.names=FALSE)



# Sauvegarder...save(tableau, file = "saveddf.txt") 



More information about the R-help mailing list