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

Instruction

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

Exercise

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))