Save a generated .txt (or .csv) file on the desktop
Mark, Many thanks for your response. Best, S ________________________________ De : Mark Sharp <msharp at TxBiomed.org> Cc : R-help Mailing List <r-help at r-project.org> Envoy? le : Lundi 30 janvier 2017 23h04 Objet : Re: [R] Save a generated .txt (or .csv) file on the desktop You can define the "file" argument in your call to write.csv() ## This will write out a file named "test_file.csv" to your working directory write.csv(tableau,file = "test_file.csv", row.names=FALSE) R. Mark Sharp, Ph.D. msharp at TxBiomed.org
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")
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
CONFIDENTIALITY NOTICE: This e-mail and any files and/or...{{dropped:10}}