options(dplyr.summarise.inform = FALSE)
#https://www.tidyverse.org/blog/2020/05/dplyr-1-0-0-last-minute-additions/
---- | |
Power BI Official Software - Cost: $0 Dimes | |
---- | |
Power BI Desktop. From the Microsoft Store updates automatically. #WINNING | |
URL: https://aka.ms/pbidesktopstore | |
Power BI Desktop. From download center requires manual updating. #NOTWINNING |
# https://www.r-graph-gallery.com/283-the-hourly-heatmap.html | |
library(ggplot2) | |
library(dplyr) # easier data wrangling | |
library(viridis) # colour blind friendly palette, works in B&W also | |
library(Interpol.T) # will generate a large dataset on initial load | |
library(lubridate) # for easy date manipulation | |
library(ggExtra) # because remembering ggplot theme options is beyond me | |
library(tidyr) |
SELECT [MovementDateTime], | |
[FirstName], | |
[LastName], | |
[Ward_Dept], | |
[Staging_Post], | |
[Movement_Type], | |
[IN_OUT], | |
cast(round(floor(cast([MovementDateTime] AS float(53))*24*4)/(24*4),5) AS smalldatetime) AS Movement15, | |
(CASE WHEN IN_OUT = 'IN' THEN 1 ELSE -1 END) AS [counter] | |
FROM [DB].[dbo].[TABLENAME] |
git branch -m master main | |
git fetch origin | |
git branch -u origin/main main | |
git remote set-head origin -a |
path <- "https://github.com/owner/repo/raw/main/somedata.rds" | |
rdsdl <- function(path){ | |
readRDS(url(path, "rb")) | |
} |
### old way | |
```r | |
df %>% | |
mutate(row = row_number()) %>% | |
gather('column', 'source', -row, -N) # key = column, value = source, retain row and N | |
# further transforms | |
``` |
# I want 18 separate folders for graphic outputs, and 17 separate folders for different outputs | |
# they will be saved in the "output" folder under my main project directory | |
library(fs) | |
library(here) | |
here <- here::here() | |
tablenos <- paste0("table",seq(1:17)) | |
fignos <- paste0("fig",seq(1:18)) |
client_id | referral_id | team_desc | referral_date | discharge_date | unique_id | |
---|---|---|---|---|---|---|
1 | 1 | Apple | 2018-11-07T00:00:00Z | 2019-10-29T00:00:00Z | 1_1 | |
2 | 1 | Banana | 2018-03-30T00:00:00Z | 2_1 | ||
2 | 2 | Apple | 2020-03-14T00:00:00Z | 2021-02-12T00:00:00Z | 2_2 | |
3 | 1 | Banana | 2017-01-18T00:00:00Z | 2017-07-30T00:00:00Z | 3_1 | |
4 | 1 | Apple | 2020-09-02T00:00:00Z | 2021-02-09T00:00:00Z | 4_1 | |
4 | 2 | Apple | 2017-06-20T00:00:00Z | 2017-11-27T00:00:00Z | 4_2 | |
4 | 3 | Clementine | 2017-08-14T00:00:00Z | 4_3 | ||
4 | 4 | Clementine | 2019-04-13T00:00:00Z | 4_4 | ||
5 | 1 | Banana | 2019-11-21T00:00:00Z | 2020-05-09T00:00:00Z | 5_1 |
teams <- c("Apple", "Banana", "Clementine") | |
dates <- seq(as.Date("2017-01-01"), as.Date("2021-01-01"), "days") | |
# 5 columns- client id, referral id, team_desc, referral_date, discharge_date | |
test_frame <- purrr::map_dfr(1 : 100, function(x){ | |
rnum <- sample(1 : 5, 1) | |
team_name <- sample(teams, rnum, replace = TRUE) |