Plotting Time Series in R
Premium
While we can explore time series data using commands such as print()
, head()
, tail()
, etc in R, it can be very helpful to plot the time series data as a line chart and explore it visually.
In the following examples, we plot the Microsoft stock data and the quarterly GDP data in two different plots using the plot()
function in R. You can alternatively also use ts.plot()
function.
Unlock Premium Content
Upgrade your account to access the full article, downloads, and exercises.
You'll get access to:
- Access complete tutorials and examples
- Download source code and resources
- Follow along with practical exercises
- Get in-depth explanations