Join Mark Niemann-Ross for an in-depth discussion in this video Walking the unit tests, part of Code Clinic: R.
- Let's walk the code.…This project is broken into three files,…unit_tests.R, shown here in RStudio,…getpendoreille_unfactored.R.…Here's factored and here's unfactored.…We'll talk about this in a minute.…And a file called LakePendOreilleData,…which looks like this, right here.…Now, let's first of all look at code that works…and then we'll look at the original code…that no longer works, so we can see…how it was improved.…
The first program to look at is unit_tests under bar POR.…Let's go to that file, and I'm showing that now…in the source window of RStudio.…Let's step through here, and see what's actually happening.…Line number 1 is a comment, and all comments…start with a # mark.…So this is just a comment that says "set up."…Line 2 is install.packages and you'll recall…we talked about installing packages.…In this line, we installed a package called "lubridate"…which gives us a more sophisticated access…to dates and times.…
The third line is a library, (lubridate),…and that pulls lubridate into the working source code.…
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.
R Statistics Essential Trainingwith Barton Poulson5h 59m Intermediate
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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.