I hereby claim:
- I am nacnudus on github.
- I am nacnudus (https://keybase.io/nacnudus) on keybase.
- I have a public key ASCRo_YM6aOXHQOlSQTyw8plq2ubGwakYHS_kdQ07xiQ9wo
To claim this, I am signing this object:
timeHMS_formatter <- function(x) { | |
x[is.na(x)] <- 0 | |
h <- trunc(x * 24) | |
m <- trunc(x * 24 * 60) | |
s <- x * 24 * 60 * 60 %% 60 | |
s <- round(s, 2) | |
lab <- sprintf('%02d:%02d:%02d', h, m, s) # Format the strings as HH:MM:SS | |
lab <- gsub('^00:', '', lab) # Remove leading 00: if present | |
lab <- gsub('^0', '', lab) # Remove leading 0 if present | |
} |
#' Match the Civil Service People Survey to the government-organisation register | |
library(tidyverse) | |
library(RegistersClientR) | |
#' Download the survey and the register | |
survey_path <- "https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/659571/Civil_Service_People_Survey_2017_All_Organisation_Scores__CSV_.csv" | |
survey <- read_csv(survey_path)[, 1:5] | |
govorg <- |
# Import the participation data | |
library(tidyverse) | |
library(tidyxl) # You'll need the dev versions devtools::install_github("nacnudus/tidyxl") | |
library(unpivotr) # You'll need the dev versions devtools::install_github("nacnudus/unpivotr") | |
library(here) | |
path <- here("inst", "extdata", "australian_marriage_law_postal_survey_2017_-_participation_final.xlsx") | |
book <- xlsx_cells(path) | |
formats <- xlsx_formats(path) |
# To install dependencies | |
# install.packages(c("devtools", "tidyverse")) | |
# install_github("openregister/RegistersClientR") | |
library(tidyverse) | |
library(RegistersClientR) | |
register <- rr_register("register") | |
register %>% |
I hereby claim:
To claim this, I am signing this object:
# Load all registers into various databases | |
library(tidyverse) | |
library(DBI) | |
library(registr) # https://github.com/nacnudus/registr | |
library(stringr) | |
library(getPass) | |
library(here) | |
beta <- rr_registers() |
library(tidyxl) | |
library(tidyverse) | |
library(unpivotr) | |
library(rvest) | |
library(stringr) | |
library(ggrepel) | |
download.file("https://smartstart.services.govt.nz/assets/files/Top-baby-names-1954-2016.xlsx", | |
destfile = "babynames.xlsx", mode = "wb") | |
babies <- tidy_xlsx("babynames.xlsx") |
# Inspired by http://www.brodrigues.co/blog/2018-09-11-human_to_machine/ | |
# https://twitter.com/brodriguesco/status/1039604517287931904 | |
# "You can find the data I will use here. Click on the “Time use” folder and you can download the workbook." | |
# http://statistiques.public.lu/stat/ReportFolders/ReportFolder.aspx?IF_Language=eng&MainTheme=3&FldrName=1&RFPath=14306 | |
library(tidyverse) | |
library(tidyxl) | |
library(unpivotr) | |
library(lubridate) |
# Inspired by http://www.brodrigues.co/blog/2018-09-11-human_to_machine/ | |
# https://twitter.com/brodriguesco/status/1039604517287931904 | |
# "You can find the data I will use here. Click on the “Time use” folder and you can download the workbook." | |
# http://statistiques.public.lu/stat/ReportFolders/ReportFolder.aspx?IF_Language=eng&MainTheme=3&FldrName=1&RFPath=14306 | |
# This time using experimental unpivotr code to allow custom filtering of header cells, rather than having to reposition them. | |
# https://github.com/nacnudus/unpivotr/commit/0961ec3c3e17b34755f0fce94db7f5bf380d43ce | |
library(tidyverse) | |
library(tidyxl) |
library(tidyverse) | |
library(ompr) | |
library(ompr.roi) | |
library(ROI.plugin.glpk) | |
M <- 3 # Volunteers (rows) | |
N <- 4 # Jobs (combination of role at given time and location) (columnss) | |
# Jobs are: | |
# 1. Greet (8am-9am) |