Skip to content

Instantly share code, notes, and snippets.

View Tadge-Analytics's full-sized avatar

Julian Tagell Tadge-Analytics

View GitHub Profile
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
library(tidyverse)
library(kableExtra)
formatted_Values <- tibble::tribble(
~Metric, ~BAKER, ~OREGON, ~RURAL, ~URBAN,
"Food insecurity", "15%", "13%", NA, NA,
"Child Poverty", "23%", "19%", "18%", "20%",
"Foster care rate (per 1,000 population)", "33", "13", "21", "11",
"Index crime (per 1,000 population)", "20", "30", "20", "32",
---
title: "Expense Analyser"
output:
flexdashboard::flex_dashboard:
navbar:
- { title: "About", href: "https://www.tadge-analytics.com.au", align: right }
runtime: shiny
---
```{r setup, include=FALSE}
# first, run the gist at:
# https://gist.github.com/Tadge-Analytics/63f75895f0b2e76dae60c1bd5ce8fec7
library(tidyverse)
vcglr_data <- readRDS("rds files/vcglr_data.rds")
# same location for start and end
# note there cannot be a Licence Num (in the VCGLR) that is 1 or 2
# We also want to identify services stations which are the same...
# but where the address is written differently
# in a way not corrected for, above...
unique_stations %>%
distinct(full_name, new_address) %>%
group_by(full_name) %>%
mutate(rank = row_number()) %>%
spread(rank, new_address) %>%
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
library(tidyverse)
# data can be downloaded from:
# https://www.dropbox.com/s/odg6udrhahsqhiz/SydneyFuelPriceHistory.zip?dl=1
first_changes <- read_csv("data/SydneyFuelPriceHistory.csv") %>%
library(tidyverse)
# Let's generate our different trials data
# and save to rds
test_if_sameness <- function(size_of_group) {
tibble(person_id = 1:size_of_group) %>%
mutate(birthday = sample(1:365, n(), replace = T)) %>%
mutate(other_dates = list(rename(., person_id1 = person_id,
birthday1 = birthday))) %>%
Dates =
VAR Days = CALENDAR(MIN('Order'[Order Date]), MAX('Order'[Order Date]) )
RETURN ADDCOLUMNS (
Days,
"Year", YEAR ( [Date] ),
"Month Number", MONTH ( [Date] ),
"Month", FORMAT ( [Date], "mmmm" ),
"Year Month Number", YEAR ( [Date] ) * 12 + MONTH ( [Date] ) - 1,
"Year Month", FORMAT ( [Date], "mmm yy" ),
"DayOfWeekNumber", WEEKDAY ( [Date] ),
library(tidyverse)
library(httr)
# retrieve the data from the web
url <- "https://www.vcglr.vic.gov.au/sites/default/files/current_victorian_licences_by_location_august_2019.xlsx"
GET(url, write_disk(tf <- tempfile(fileext = ".xlsx")))
downloaded_data <- readxl::read_excel(tf, col_names = F, col_types = "text")
library(dplyr)
library(magrittr)
library(Rserve)
Rserve(port = 1234)
process_data <- function(data) {
library(tidyverse)
library(gmailr)
# authorise gmailr
search_term <- "from:([email protected]) new jobs for tableau in Melbourne"
messageIDs <- messages(search = search_term, num_results = 5)
my_messages <- tibble(messageIDs) %>%
mutate(downloaded_data = map(messageIDs, ~.x$messages %>%