forked from lindblb/pro_reports_talk
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathsetup.R
41 lines (21 loc) · 757 Bytes
/
setup.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
library(DBI)
library(glue)
library(here)
library(janitor)
library(kableExtra)
library(lubridate)
library(maps)
library(RSQLite)
library(scales)
library(sf)
library(tidyverse)
# Get dates ---------------------------------------------------------------
this_month <- lubridate::today() %>% lubridate::month()
this_year <- lubridate::today() %>% lubridate::year() - 1
# Set up connection to db -------------------------------------------------
db <- DBI::dbConnect(RSQLite::SQLite(), dbname="database/prod.sqlite")
# Get data to map over ----------------------------------------------------
input_data <- DBI::dbReadTable(conn = db,
name = "financials") %>%
dplyr::select(branch) %>%
dplyr::distinct()