Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to let user choose output file name in writecsv

Tags:

r

csv

Any idea how to let the user choose the filename to save using this function ?

write.csv(tweets, file = "newfile.csv",
          row.names = TRUE, sep = ',', 
          col.names = TRUE)

Something like how we use the save as function and then a browser option appears.

like image 254
Napmi Avatar asked Dec 20 '25 09:12

Napmi


1 Answers

Try ?file.choose. That should bring up the window that lets you navigate to the folder you want, and enter the file name you want to save under. That is:

write.csv(tweets, file=file.choose(), row.names=TRUE, sep=',', 
          col.names=TRUE)
like image 66
gung - Reinstate Monica Avatar answered Dec 22 '25 23:12

gung - Reinstate Monica



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!