[Shiny on a train] (http://suce.co.uk:8080/apps/nhs-r_fomo/) Thanks to [Chris Beeley] (https://chrisbeeley.net/)
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
sqlFetchData <- function(connection, database, schema, table, nobs = 'All') { | |
#'wrap function to fetch data from SQL Server | |
# | |
#@ connection: an established odbc connection | |
#@ database: database name | |
#@ schema: a schema under the main database | |
#@ table: the name of the data table to be fetched. | |
#@ nobs: number of observation to be fetched. Either 'All' or an integer number. | |
# The default value is 'All'. It also supports the input of 'all', 'ALL' and |
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
https://jaxenter.com/10-sql-tricks-that-you-didnt-think-were-possible-125934.html |
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
https://guides.library.upenn.edu/datamgmt/spreadsheet | |
https://www.tandfonline.com/doi/full/10.1080/00031305.2017.1375989 | |
https://about.dataclassroom.com/blog/2019/10/23/keep-your-data-tidy | |
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
https://community.qlik.com/t5/QlikView-Documents/QlikView-UK-Maps/ta-p/1479536 |
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
# there are a few ways of doing this.. here's one | |
`%notin%` = function(x, y) !(x %in% y) |
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(NHSRdatasets) # install from github for latest dataset | |
library(runcharter) | |
library(data.table) | |
library(magrittr) | |
# Load | |
data("ae_attendances") | |
DT <- setDT(ae_attendances) |
I hereby claim:
- I am johnmackintosh on github.
- I am johnmackintosh (https://keybase.io/johnmackintosh) on keybase.
- I have a public key ASDQIp7YliqUjDZBfWl37te22cunTdTKJ2nKeYaEyF9Wdgo
To claim this, I am signing this object:
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
#Setup current fixtures and points per outcome | |
library(dplyr) | |
library(purrr) | |
library(tidyr) | |
library(ggplot2) | |
library(ggalt) | |
library(ggrepel) | |
library(ggExtra) | |
library(stringr) |
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
plot_data <- data %>% | |
mutate(Movement15 = lubridate::floor_date(MovementDateTime,"15 minutes")) %>% | |
group_by(IN_OUT, Movement_Type,Staging_Post,Movement15) %>% | |
mutate(counter = if_else(IN_OUT == 'IN',1,-1), | |
Movement_15_SEQNO = cumsum(counter)) %>% | |
ungroup() |