Crypto Currencies

Plotting Crypto Currencies using the tidyverse.

Questions

  1. Load object data/06-plotting-06.rda
  2. Plot Time Series line chart using ggplot()
    • Use gather() reformat the data.frame from wide to long format using Date as id variable.
    • Use facet_grid() to plot to different panels, adjust parameter scales.
    • Remove x-axis label (xlab()) for each plot, set y-axis label to USD.
  3. What do we observe? Hint: Zoom to time frame where no NA's are present (e.g. from 2017-07-01) or consider na.omit() before step 2.
  4. Plot relative performances by indexing each coin to 100 at the start, adjust y-axis as necessary. Use scale_y_continuous(labels = scales::percent) to format y-axis as percent.
  5. Which coin performed best in percentage terms? Use absolute performance numbers from 4. and show the absolute performance numbers for each coin on the last observation day.
  6. Select performances for the first day of each month output the resulting table. Hint Use filter() with floor_date to filter rows for the start of each month. Bonus: Calculate the MOM returns using group_by(coin) and mutate() to calculate the difference price_adj - lag(price_adj).

1. Read Data

load(file = "data/06-plotting-06.rda")