Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
13. Exercise 2


Great, let's calculate how long guests stay at our hotel.


Calculate the length of guests' stays. Use the interval() and as.period() function on the start_date and end_date columns. Assign the results to the new column: length_of_stay.

Stuck? Here's a hint!

Here's a piece of code to help you get started:

as.period(interval(start, end))