Aan de slagGa gratis aan de slag

A simple time series plot

Your task is to create an interactive time series plot of the opening price of the MSCI All Country World Index, instead of the closing price previously plotted.

Remember that the msci data set contains daily information on the trading price of the iShares MSCI All Country World Index ETF including:

  • Date: the date
  • Open: opening price
  • High: high price
  • Low: low price
  • Close: closing price
  • Volume: number of trades˙
  • Adjusted: adjusted closing price

After you create the plot, play around with it! Explore the ways that you can interact with plots in plotly, such as "Pan", "Zoom", and "Toggle Spike Lines".

Deze oefening maakt deel uit van de cursus

Intermediate Interactive Data Visualization with plotly in R

Cursus bekijken

Oefeninstructies

  • Load the plotly package.
  • Fill in the code to create an interactive time series plot with Open on the y-axis and Date on the x-axis.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# load the plotly package
library(___)

# Create a times series plot of Open against Date
acwi %>% 
    plot_ly(x = ___, y = ___) %>% 
    add_lines()
Code bewerken en uitvoeren