课程: R for Data Science: Lunch Break Lessons

免费学习该课程!

今天就开通帐号,24,100 门业界名师课程任您挑!

Lubridate

Lubridate

- When talking about dates and times in R, no conversation is complete until we bring up lubridate. And this is part of the tidyverse. It's not part of base R, but it's a very popular package. Let's look at how lubridate converts dates and times into internal R objects. The first thing you'll need to do is install that package. To install lubridate, you type in install.packages("lubridate"). Incidentally, if you install tidyverse, this will install lubridate along with all of the other tidyverse objects. Of course, anytime when you install packages, you do have to use the library command in order to pull that package into play. Now of course there's a help file for lubridate. We'll type in ?lubridate and you'll see an extensive help file. There's also a quick reference for lubridate and I've included the URL in the example files for this course. Now how does it work? Well, first of all, let's create a date time object.…

内容