如何让用户在writecsv中选择输出文件名 [英] How to let user choose output file name in writecsv

查看:41
本文介绍了如何让用户在writecsv中选择输出文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么想法让用户选择使用此功能保存的文件名吗?

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)

这篇关于如何让用户在writecsv中选择输出文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆