Join Mark Niemann-Ross for an in-depth discussion in this video Brute force: Dealing with rows, part of Code Clinic: R (2015).
- So now we need to look at filtering out invalid rows.…First, what does an invalid row look like?…Right now we're looking at a plot of a value of…1, 1, 1, 1, 1, 1, 1, 1…which puts all of the queens in the first row.…Well, obviously all of the queens can attack each other,…because they simply have to move horizontally.…This is not a valid solution.…And in fact, any solution where a queen is in the same row…is an invalid solution.…
So we need to filter all of these out.…I've used two parts to solve this part of the problem.…One of them is a command called Apply,…and one of them is Count Unique.…Apply is a built-in part of the R language.…Unique is a function that I created.…Let me explain both of them one at a time.…I'm going to open up the Console…and illustrate Apply, I need to create a matrix.…Let's create one called thisMatrix.…
And I'm going to assign to thisMatrix a matrix.…That matrix is going to consist of the numbers…one through 20.…The matrix is going to have five rows,…and it's gonna have four columns.…
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?
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.