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) | |
setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) | |
countries <- c("AE", "AF", "AN", "AO", "AR", "AS", "AT", "AU", "BB", "BD", | |
"BE", "BF", "BH", "BM", "BN", "BR", "BY", "CA", "CH", "CL", "CN", | |
"CO", "CR", "CZ", "DE", "DK", "DZ", "EC", "EE", "EG", "ES", "ET", | |
"FI", "FO", "FR", "GA", "GB", "GE", "GH", "GI", "GR", "GT", "HK", | |
"HN", "HR", "HU", "ID", "IE", "IL", "IN", "IR", "IS", "IT", "JM", | |
"JO", "JP", "KE", "KH", "KR", "KW", "KZ", "LA", "LB", "LK", "LT", | |
"LU", "LV", "MA", "MN", "MO", "MT", "MU", "MX", "MY", "NG", "NI", |
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(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 %>% |
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(dplyr) | |
library(magrittr) | |
library(Rserve) | |
Rserve(port = 1234) | |
process_data <- function(data) { |
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(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") | |
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
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] ), |
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) | |
# 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))) %>% |
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
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") %>% |
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
# 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) %>% |
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
# 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 |
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
--- | |
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} |
OlderNewer