knitr::opts_chunk$set(echo = TRUE)

from nswgov

packages

library(tidyverse)
library(readxl)
library(here)
library(janitor)
library(lubridate)

Read the data, clean names

nswgov <- read_csv(here::here("data", "nswgov_daily.csv")) %>%
  clean_names()

Change dates to date format

nswgov$date <- dmy(nswgov$date)

glimpse(nswgov)

Make it long

nswgov_long <- nswgov %>%
  select(1:27) %>%
  pivot_longer(names_to = "site", values_to = "aqi", 2:27) 

Plot

nswgov_long %>%
  ggplot(aes(x = date, y = aqi, colour = site)) +
  geom_point() +
  theme(legend.position = "none")
nswgov_long %>%
  filter(date > "2018-12-31") %>%
ggplot(aes(x = date, y = aqi, colour = site)) +
  geom_point() +
  theme(legend.position = "none")


ropenscilabs/smoky documentation built on May 17, 2022, 11:57 a.m.