Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save a file interactively?

Tags:

file-io

r

Using tk_choose.files or file.choose I am able to select a file interactively. Is there an analogous function wherein I can allow a user to interactively decide where to save the output of a write.table?

like image 895
Maiasaura Avatar asked Jan 20 '23 16:01

Maiasaura


1 Answers

On Windows 7 and working through the RGUI, I can specify something like:

write.table(x = iris, file = file.choose())

which pops open a Windows Explorer dialogue. I can then navigate to any existing file, create a new file by right clicking, or simply by typing the name of a new file where it will ask to create a new file.

I guess this may not be platform independent...can others with the appropriate OS's verify?

like image 65
Chase Avatar answered Jan 30 '23 20:01

Chase