Comparing temporal attributes
The start and end points of a time series are stored like any other date or time object in R, meaning you can perform tests to compare them, as well as perform arithmetic to determine the time interval between them.
Use your R skills to manipulate the temporal attributes of card_prices
– a time series of the daily prices of a card from a popular trading card game.
The card_prices
time series, and the zoo
and lubridate
packages, are available to you.
This exercise is part of the course
Manipulating Time Series Data in R
Exercise instructions
Assign the start point of
card_prices
to the variablecard_start
.Assign the end point of
card_prices
to the variablecard_end
.Subtract
card_start
fromcard_end
and view the result.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Assign the start point to card_start
___
# Assign the end point to card_end
___
# Subtract the start point from the end point
___