BaşlayınÜcretsiz Başlayın

Big tech stock prices

You're an analyst at an investment firm and want to visualize the weekly closing prices of five big tech firms' stocks. However, the dataset you've been handed (stock_df) is messy and has the year and week variables stored in the column headers. You'll pivot this data into a tidy format, extract the variables from the headers, and create a line plot.

The ggplot2 package has been pre-loaded for you.

Bu egzersiz

Reshaping Data with tidyr

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

stock_df %>% 
  # Pivot the data to create 3 new columns: year, week, price
  ___
Kodu Düzenle ve Çalıştır