Exercise

Load the monthly Starbucks return data

In this first lab, you will analyze the monthly stock returns of Starbucks (ticker: SBUX).

Let us get started by downloading the monthly return data from http://assets.datacamp.com/course/compfin/sbuxPrices.csv, and by using the read.csv() function. Type ?read.table in the console to consult the help file.

In the read.csv() function, you should indicate that the data in the CSV file has a header (header argument) and that strings should not be interpreted as factors (stringsAsFactors argument).

Instructions

100 XP
  • Create a new variable data_url that contains the URL to the CSV file.
  • Create a new variable sbux_df that contains the data frame with the Starbucks data. sbux_df should be a data frame object. Data frames are rectangular data objects that contain observations in their rows and variables in their columns.