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.
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)
Alternatively, you can use choose.files()
to get a little more of the typical Windows "Save as" behavior:
Default to .csv file type without the user having to type it
write.csv(tweets, file=choose.files(caption="Save As...", filters = c("Comma Delimited Files (.csv)","*.csv")))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.