Get startedGet started for free

Cross reference sources

In this exercise, you will cross-reference the AAPL raw price data from the previous exercise with AAPL data from another source.

The new data is already adjusted for splits, but not dividends. So the close prices from the new data won't align closely with the adjusted close prices from the previous exercise (which are adjusted for both splits and dividends). You will learn more about the adjustment process in the next video.

You will compare raw, unadjusted AAPL data with split-adjusted AAPL data. The data have already been loaded to your workspace in aapl_raw and aapl_split_adjusted, respectively.

This exercise is part of the course

Importing and Managing Financial Data in R

View Course

Exercise instructions

  • Use head() to look at the first few rows of aapl_raw.
  • Look at the first few rows of aapl_split_adjusted. Note the close prices in aapl_split_adjusted are not identical to the adjusted close prices in aapl_raw.
  • Finish the command to plot the difference between Adjusted close in aapl_raw and the Close in aapl_split_adjusted.
  • Finish the command to plot the difference between the Volumes in aapl_raw and in aapl_split_adjusted.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Look at first few rows of aapl_raw


# Look at first few rows of aapl_split_adjusted


# Plot difference between adjusted close and split-adjusted close
plot(Ad(___) - Cl(___))

# Plot difference between volume from the raw and split-adjusted sources
plot(Vo(___) - Vo(___))
Edit and Run Code