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.

seq.Date()

seq.Date()

- [Instructor] In past episodes, we've talked about the S-E-Q or sequence command. And you may not know it, but you can use it with dates as well. And it's really convenient, but it involves a little bit of setup. So let's take a look at how it works. Now, I've typed in a bunch of examples, and these are all in the example files you'll find with this recording in the LinkedIn Learning library. Let's start with line three. Sequence from Sys.Date by month, length.out equals three. I'm going to go ahead and run that, and we'll see what comes out. Now, I can tell you for starters that Sys.Date, S-Y-S dot D-A-T-E, is 2022, April 17th. So, if you look at the results from line three, you'll see that I have 2022, April 17th, 2022-05-17, or May 17th, and 2022-06, or June. What line three has done is created three months starting from the current Sys.Date. And you can see how that's all been typed in to the…

Contents