lubridate
to Work with DatesToday we will…
Revisions are due by Friday
Any problem receiving a “Growing” can be revised and submitted for additional feedback
Make sure your feedback follows the code review guidelines.
Insert your review into the comment box!
You will create a Midterm Portfolio, with code covering the learning targets we have covered thus far in the course.
git
and sign-up for a GitHub accountWhen parsing dates and times, we have to consider complicating factors like…
lubridate
Convert a date-like variable (“May 8, 1995”) to a date or date-time object.
Find the weekday, month, year, etc from a date-time object.
Convert between time zones.
Note
The lubridate
package installs and loads with the tidyverse
.
date-time
ObjectsWhat’s wrong here?
Make sure you use quotes!
date-time
Componentsdate-time
ObjectsDoing subtraction gives you a difftime
object.
difftime
objects do not always have the same units – it depends on the scale of the objects you are working with.
We can also add time to date-time
objects:
days()
, years()
, etc. will add a period of time.ddays()
, dyears()
, etc. will add a duration of time.Suppose American Airlines requires members to travel within 4 weeks before or after their birthday to earn a “Birthday Bonus Flight.”
…are complicated!
Specify time zones in the form:
You can change the time zone of a date in two ways:
with_tz()
When you read data in or create a new date-time object, the default time zone (if not specified) is UTC (Universal Time Coordinated)*.
*UTC is the same as GMT (Greenwich Mean Time)
None of us have all these abilities. Each of us has some of these abilities.
During the Practice Activity, you are not permitted to use Google or ChatGPT for help.
You are permitted to use:
lubridate
cheatsheet,Submit the name of the thief to the Canvas Quiz.
The partner who has broken the most bones starts as the Talker!
The partner who has broken the most bones starts as the Talker!