This file contains hidden or 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(data.table) | |
| library(hildaData) | |
| library(hildaExtra) | |
| library(dplyr) | |
| library(dtplyr) | |
| library(magrittr) | |
| get_hilda_xwaveid_age_income <- function(year){ | |
| wave <- letters[year - 2000] | |
| if (year == 2014){ |
This file contains hidden or 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(dplyr) | |
| library(data.table) | |
| library(dtplyr) | |
| library(magrittr) | |
| tbl_sequential <- | |
| CJ(Year = 2011:2014, | |
| Month = 1:12) %>% | |
| mutate(Date = as.Date(paste(Year, Month, "01", sep = "-"))) %>% |
This file contains hidden or 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
| write_to_sandbox <- function(filename){ | |
| dat <- get(gsub("^.*/([A-Za-z0-9_]+)\\.rda$", "\\1", filename)) | |
| fwrite(dat, paste0("~/sandbox/taxstats/", gsub("^.*/([A-Za-z0-9_]+)\\.rda$", "\\1", filename), ".csv")) | |
| } | |
| check_which_nonascii <- function(filename){ | |
| tools::showNonASCIIfile(filename) | |
| cat(filename, "\n") | |
| } |
This file contains hidden or 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(taxstats) | |
| library(data.table) | |
| library(grattan) | |
| library(dplyr) | |
| library(dtplyr) | |
| library(magrittr) | |
| sample_file_1314 %>% | |
| project_to(fy.year.of.sample.file = "2013-14", to_fy = "2016-17") %>% | |
| merge(age_range_decoder) %>% |
This file contains hidden or 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(dplyr) | |
| library(dtplyr) | |
| library(magrittr) | |
| library(data.table) | |
| library(taxstats) | |
| library(grattan) | |
| MYEFO <- | |
| data.table(fy_year = yr2fy(2017:2020), | |
| r = c(0.023, 0.025, 0.033, 0.035)) |
This file contains hidden or 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(testthat) | |
| library(dplyr) | |
| library(dtplyr) | |
| library(data.table) | |
| library(hildaData) | |
| library(hildaExtra) | |
| library(sih.hilda.1314) | |
| library(taxstats) | |
| library(magrittr) |
This file contains hidden or 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
| if (requireNamespace("bomrang", quietly = TRUE)) { | |
| library(data.table) | |
| library(bomrang) # devtools::install_github('ToowoombaTrio/bomrang') | |
| `_nrst_stn_to_me` <- as.numeric(jsonlite::fromJSON("http://ip-api.com/json")[c("lat", "lon")]) | |
| weather_here <- function() { | |
| bomrang::get_current_weather(latlon = `_nrst_stn_to_me`, as.data.table = TRUE) %>% | |
| .[, .(local_date_time, weather, rel_hum, apparent_t, air_temp, wind_dir, wind_spd_kt, gust_kt)] %>% | |
| head | |
| } |
This file contains hidden or 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
| formalCoverage <- function(fn) { | |
| formalz <<- formals(fn) | |
| bod <<- as.character(body(fn)) | |
| formal_present <- function(formal) { | |
| formal_dots_escaped <<- gsub(".", "\\.", formal, fixed = TRUE) | |
| any(grepl(pattern = paste0("(?:\\b|\\s)", formal_dots_escaped, "(?:\\b|\\s)"), | |
| x = bod, | |
| perl = TRUE)) |
This file contains hidden or 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(data.table) | |
| library(hildaData) | |
| library(magrittr) | |
| library(grattanCharts) | |
| library(ggplot2) | |
| #' @source acid package (but it's chock full of unnecessary dependencies) | |
| weighted_gini <- function (x, w = NULL) { | |
| if (is.null(w)) | |
| w <- rep(1, length(x)) |
This file contains hidden or 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(grattanCharts) # devtools::install_github('hughparsonage/grattanCharts') | |
| library(dplyr) | |
| library(httr) | |
| library(tidyr) | |
| library(readxl) | |
| library(scales) | |
| library(ggplot2) | |
| library(data.table) | |
| library(lubridate) | |
| library(hutils) |