Join Mark Niemann-Ross for an in-depth discussion in this video Walking the directory sort code, part of Code Clinic: R (2015).
- To recap, I've divided the problem into three phases.…First we're going to search directories for images,…then we're going to find image data from those images,…and then we're gonna sort it into directories.…Let's go ahead and take a look at the code that does that.…We're looking at a file called readFileInfo.R…that's located in the Exercise Files.…Let's start at the top, walk through…and see what actually happens.…The first couple of lines are comments…just to make sure that we've installed ImageMagick.…
We've talked about that earlier,…but we need to remember to do it.…Line 6 is just simply a call…to pull in the tools library,…we can go ahead and run that.…And we'll open this back up again.…Now let's go look at lines 8, 9, and 10.…Line 10 creates a variable called directoryToStart…and (mumbling) a path name…to a folder called Exercise Files.…Depending on how your computer is set up…you may wanna change this line…to point to the correct folder.…
Line 11 then goes ahead and does all the work for us here.…We're creating a variable called foundImages…
Mark introduces challenges and then provides an overview of his solutions in R. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.
Skill Level Intermediate
Q: R Studio tells me that it can't find files I expect to be available. Where can I find them?
A: Use the setwd() command to set the working directory to match the folder you're working in.
Q: I am unable to access the Lake Pend Oreille data from outside the U.S.
A: A static copy of this data is provided here for lynda.com members outside of the U.S.
1. Problem One: Statistical Analysis
2. Problem Two: Image Analysis
3. Problem Three: Eight Queens
4. Accessing Peripherals
5. Recursion and Directories
Walking the directory sort code10m 56s
6. Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.