Skip to content

Commit

Permalink
Update the vigenette
Browse files Browse the repository at this point in the history
  • Loading branch information
JayaniLakshika committed May 29, 2024
1 parent 0b9f9f2 commit 5f6a8fd
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 3 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
^\.github$
^LICENSE\.md$
^README\.Rmd$
^key.txt
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Description: This package allows users to easily retrieve air quality data from
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Imports:
assertthat,
httr,
Expand Down
6 changes: 5 additions & 1 deletion example/example1.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ tb <- get_measures(qr)
unique(tb$parameter)
nrow(tb)

a <- get_measurements_for_location(country = "AU", city = "Melbourne", location = "Footscray", max_observations = 100, date_from = lubridate::ymd("2024-05-24"), parameter = c("pm10", "pm25"))
a <- get_measurements_for_location(country = "AU", city = "Melbourne",
location = "Footscray",
max_observations = 100,
date_from = lubridate::ymd("2024-05-24"),
parameter = c("pm10", "pm25"))
1 change: 1 addition & 0 deletions key
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set_openaq_api_key("5132becb89bac7d410e81eadd4384894789b141ba1e5a18b2ac4f599bf132bc5")
47 changes: 47 additions & 0 deletions man/collate_paginated_output.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added man/figures/.DS_Store
Binary file not shown.
Binary file added vignettes/air_quality_map.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion vignettes/map-in-australia.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ library(ozmaps)
library(sf)
library(dplyr)
library(ggplot2)
library(colorspace)
library(tsibble)
library(gganimate)
states <- ozmaps::ozmap_states |>
filter(NAME %in% c("New South Wales", "Victoria"))
Expand All @@ -40,7 +43,7 @@ a <- get_measurements_for_location(
locations_of_interest <- a |>
filter(long > 141, lat < -31) |>
distinct(location_id) |>
distinct(location) |>
pull()
station_data <- get_measurements_for_location(
Expand Down Expand Up @@ -74,6 +77,7 @@ animated_plot <- ggplot() +
geom_sf(data = states) +
geom_point(aes(x = long, y = lat, colour = log(value)), data = time_series_stations) +
transition_time(date_utc) +
scale_color_continuous_sequential(palette = "Heat")+
labs(subtitle = "Date: {frame_time}")
anim_save("air_quality_map.gif", nframes = 300, fps = 10, width = 800, height = 600, animation = animated_plot, renderer = gifski_renderer())
Expand Down

0 comments on commit 5f6a8fd

Please sign in to comment.