Session Ready
Exercise

Import daily weather data

In practice you won't be parsing isolated dates and times, they'll be part of a larger dataset. Throughout the chapter after you've mastered a skill with a simpler example (the release times of R for example), you'll practice your lubridate skills in context by working with weather data from Auckland NZ.

There are two data sets: akl_weather_daily.csv a set of once daily summaries for 10 years, and akl_weather_hourly_2016.csv observations every half hour for 2016. You'll import the daily data in this exercise and the hourly weather in the next exercise.

You'll be using functions from dplyr, so if you are feeling rusty, you might want to review filter(), select() and mutate().

Instructions
100 XP
  • Import the daily data, "akl_weather_daily.csv" with read_csv().
  • Print akl_daily_raw to confirm the date column hasn't been interpreted as a date. Can you see why?
  • Using mutate() overwrite the column date with a parsed version of date. You need to specify the parsing function. Hint: the first date should be September 1.
  • Print akl_daily to verify the date column is now a Date.
  • Take a look at the data by plotting date on the x-axis and max_temp of the y-axis.