[This is my OpenPGP fingerprint: openpgp4fpr:18c66c11c2904d52c061c903400c472b1687e621]
Feel free to verify this at any online keyoxide instance or on the keyoxide mobile app.
[This is my OpenPGP fingerprint: openpgp4fpr:18c66c11c2904d52c061c903400c472b1687e621]
Feel free to verify this at any online keyoxide instance or on the keyoxide mobile app.
# get DPIRD CVT zones from the Public Services Slip WA as an {sf} object in R | |
# data are CC 4.0 and available from: <https://data.wa.gov.au/slip> | |
wfs_wa <- | |
"https://public-services.slip.wa.gov.au/public/services/SLIP_Public_Services/Boundaries_WFS/MapServer/WFSServer" | |
url <- httr2::url_parse(wfs_wa) | |
url$query <- list(service = "wfs", | |
#version = "2.0.0", # facultative | |
request = "GetCapabilities") |
# Fetch historical weather data with Python using various packages | |
# use plotnine for graphing | |
from plotnine import * | |
import pandas as pd | |
import pathlib | |
# pynasapower | |
# Fetches NASA POWER data |
library("nasapower") | |
library("purrr") | |
library("dplyr") | |
df <- data.frame( | |
stringsAsFactors = FALSE, | |
lon = c(151.81, 112.5, 115.5), | |
lat = c(-27.48, -55.5, -50.5), | |
date = c("3/3/2023", "5/12/2023", "1/3/2024") | |
) |
- Project '~/tmp/OceanOmics-classifier-comparison' loaded. [renv 1.0.3] | |
> targets::tar_make() | |
> dispatched target all_results_files | |
o completed target all_results_files [0 seconds] | |
> dispatched branch all_results_ecfccd47 | |
o completed branch all_results_ecfccd47 [0 seconds] | |
> dispatched branch all_results_eccc5a34 | |
o completed branch all_results_eccc5a34 [0 seconds] | |
> dispatched branch all_results_05574669 | |
o completed branch all_results_05574669 [0 seconds] |
# Get all DPIRD boundary data sets available from the Public Services Slip WA and save data for use in an R package. | |
# HT to Thierry Onkelinx, Hans Van Calster, Floris Vanderhaeghe for their post, | |
# <https://inbo.github.io/tutorials/tutorials/spatial_wfs_services/>, but I | |
# modified this to work to save .Rds files for use in an R package, not just | |
# saving to disk and chose to use {httr2} in place of {httr}. | |
# NOTE: This URL is only for public boundaries, | |
<https://public-services.slip.wa.gov.au/public/services/SLIP_Public_Services/Boundaries_WFS/MapServer/WFSServer>, | |
there are others, see <https://catalogue.data.wa.gov.au/dataset> for other orgs and types of data |
# Find stations in both the DPIRD and SILO weather station networks given a | |
# vector of locations or capture messages when no stations are found | |
library("tidygeocoder") | |
library("data.table") | |
library("weatherOz") | |
library("purrr") | |
# Step 1: Create a vector of named locations to geocode |
StatQuantileBin <- ggplot2::ggproto("StatQuantileBin", ggplot2::StatBin, | |
default_aes = ggplot2::aes(x = ggplot2::after_stat(density), y = ggplot2::after_stat(density), weight = 1), | |
compute_group = function(data, scales, | |
binwidth = NULL, bins = 30, breaks = NULL, trim = 0, | |
closed = c("right", "left"), pad = FALSE, | |
flipped_aes = FALSE, | |
# The following arguments are not used, but must | |
# be listed so parameters are computed correctly | |
origin = NULL, right = NULL, drop = NULL, |
# Download any data file from a private GitHub repo | |
# regardless of how large it is. | |
# Returns a string that will then need to be parsed | |
# by read_csv or the like to turn it into a data frame. | |
# Dependencies | |
require(tidyverse) | |
require(httr) | |
require(rlist) | |
require(jsonlite) |
# Entering data | |
week <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) | |
YLI <- c(3, 4, 5, 2, 6, 5, 4, 3, 5, 6, 2, 4) | |
YLS <- c(10, 11, 11, 12, 10, 11, 11, 10, 12, 13, 10, 11) | |
rainfall <- c(1, 10, 8, 6, 65, 30, 2, 10, 8, 6, 65, 30) | |
# Creating Data Frame | |
perf <- data.frame(week, YLI, YLS, rainfall) | |
# Plotting Charts and adding a secondary axis |