Last active
June 27, 2024 13:14
-
-
Save jduckles/b7b8d45a788bd6f51f0f1160ea8275ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(jsonlite) | |
# Look for manifest in bucket "example-public-bucket" | |
data_manifest <- as_tibble(fromJSON("https://abacusworkflows.blob.core.windows.net/example-public-bucket/manifest.json")) | |
# Select down from manifest to just records with shortname "nz_stats_livestock" | |
livestock_record <- data_manifest %>% filter(shortname == "nz_stats_livestock") | |
# Open first file of nz_stats_livestock record | |
livestock_data <- read_csv(livestock_record$files[[1]]) | |
# Cleanup dates | |
livestock_data <- livestock_data %>% mutate(Year = as.numeric(str_remove_all(Year, "As at June 30 "))) | |
# Plot | |
ggplot(livestock_data, aes(x=Year, y=Value, group=Livestock, color=Livestock)) + facet_wrap(~Area) + geom_line() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment