From the course: R for Data Science: Lunch Break Lessons

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

file.choose

file.choose

If you've written a program that accesses a disk on file, you may want to interactively choose which disk on file you're using. And for that, our provides file choose, choose files, and list files. Some of these are only for Windows, and some are interactive, so let's step through each of these options and find out how they work. First, let's start with file choose. And I'll show you how this works. File.choose, and this allows me to interactively chose one file from the file system. So I click on it and I open, and it returns the path name to that file. You'll notice that it doesn't return the actual file, just the path name. It's up to you to go out and read that. If you're using Windows, you can use choose files. I'm currently on a Macintosh and so what I'm going to see is an error message, and the important thing to realize here is if you're writing programs that are going to be run on a Macintosh or on a Windows, you may want to check to see which systems you're running to decide…

Contents