Join Mark Niemann-Ross for an in-depth discussion in this video A cross-correlation with a lag of 2, part of Code Clinic: R (2015).
- Now there's another plot that we can generate,…and this is a little bit more complex.…It actually shows how lag works.…This plot is gonna show us a lag of two…between dataX and dataY.…Let's step through it real quick.…The first thing that line 23 will do…is create a new variable called dataYLag2.…It's creating a combination of dataY,…which is 3:10 with dataY 1,2.…Let's take a look at that…and see what I actually get.…So if I select that line and then hit Run,…you'll see that we now have dataYLag2.…
The contents of dataYLag2,…which you can look at either in the Environment…tab to the right or we can look at it…in the Console simply by typing in data.…Let me go down to the Console down here.…There we are.…Type in dataYLag2,…and I hit Return, and I see that dataYLag2…contains 3 4 5 6 7 8 9 10…1 2, and what we've done is shifted…dataY by two values.…
You'll recall that dataY…is 1 2 3 4 5 6 7 8 9 10.…Now if we look at 24, we'll see exactly what I just did,…data.frame(dataX compared to dataY…compared to dataYLag2).…So let's go ahead and run that line.…
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.