Centralize library loading in 00_paths.R to suppress dplyr startup messages

This commit is contained in:
2026-03-09 14:34:43 -04:00
parent d0a49ba45b
commit 8a30fe338e
19 changed files with 68 additions and 17 deletions

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata

View File

@@ -0,0 +1,7 @@
month,value_usd,population,income_per_person
jan,45360000,22600000,2.01
feb,42660000,22600000,1.89
mar,47736000,22650000,2.11
apr,45144000,22650000,1.99
may,46548000,22700000,2.05
jun,43848000,22700000,1.93
1 month value_usd population income_per_person
2 jan 45360000 22600000 2.01
3 feb 42660000 22600000 1.89
4 mar 47736000 22650000 2.11
5 apr 45144000 22650000 1.99
6 may 46548000 22700000 2.05
7 jun 43848000 22700000 1.93

View File

@@ -0,0 +1,7 @@
id,category,denomination,month,value_usd
1,income,usd,jan,45360000
1,income,usd,feb,42660000
1,income,usd,mar,47736000
1,income,usd,apr,45144000
1,income,usd,may,46548000
1,income,usd,jun,43848000
1 id category denomination month value_usd
2 1 income usd jan 45360000
3 1 income usd feb 42660000
4 1 income usd mar 47736000
5 1 income usd apr 45144000
6 1 income usd may 46548000
7 1 income usd jun 43848000

View File

@@ -0,0 +1,2 @@
id,category,denomination,jan,feb,mar,apr,may,jun
1,income,usd,45360000,42660000,47736000,45144000,46548000,43848000
1 id category denomination jan feb mar apr may jun
2 1 income usd 45360000 42660000 47736000 45144000 46548000 43848000

View File

@@ -0,0 +1,7 @@
id,category,denomination,month,value_usd,population
1,income,usd,jan,45360000,22600000
1,income,usd,feb,42660000,22600000
1,income,usd,mar,47736000,22650000
1,income,usd,apr,45144000,22650000
1,income,usd,may,46548000,22700000
1,income,usd,jun,43848000,22700000
1 id category denomination month value_usd population
2 1 income usd jan 45360000 22600000
3 1 income usd feb 42660000 22600000
4 1 income usd mar 47736000 22650000
5 1 income usd apr 45144000 22650000
6 1 income usd may 46548000 22700000
7 1 income usd jun 43848000 22700000

View File

@@ -0,0 +1,7 @@
state,category,unit,month,value
FL,population,persons,jan,22600000
FL,population,persons,feb,22600000
FL,population,persons,mar,22650000
FL,population,persons,apr,22650000
FL,population,persons,may,22700000
FL,population,persons,jun,22700000
1 state category unit month value
2 FL population persons jan 22600000
3 FL population persons feb 22600000
4 FL population persons mar 22650000
5 FL population persons apr 22650000
6 FL population persons may 22700000
7 FL population persons jun 22700000

View File

@@ -0,0 +1,7 @@
month,value_usd,population,income_per_person
jan,45360000,22600000,2.0071
feb,42660000,22600000,1.8876
mar,47736000,22650000,2.1075
apr,45144000,22650000,1.9931
may,46548000,22700000,2.0506
jun,43848000,22700000,1.9316
1 month value_usd population income_per_person
2 jan 45360000 22600000 2.0071
3 feb 42660000 22600000 1.8876
4 mar 47736000 22650000 2.1075
5 apr 45144000 22650000 1.9931
6 may 46548000 22700000 2.0506
7 jun 43848000 22700000 1.9316

2
data/raw/df_income.csv Normal file
View File

@@ -0,0 +1,2 @@
id,category,denomination,jan,feb,mar,apr,may,jun
1,income,euro,42000000,39500000,44200000,41800000,43100000,40600000
1 id category denomination jan feb mar apr may jun
2 1 income euro 42000000 39500000 44200000 41800000 43100000 40600000

View File

@@ -0,0 +1,2 @@
state,category,unit,jan,feb,mar,apr,may,jun
FL,population,thousands,22600,22600,22650,22650,22700,22700
1 state category unit jan feb mar apr may jun
2 FL population thousands 22600 22600 22650 22650 22700 22700

14
powershell_example.Rproj Normal file
View File

@@ -0,0 +1,14 @@
Version: 1.0
ProjectId: eefd8667-a6d0-4498-9b76-03f1e7bd10c9
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX

View File

@@ -2,7 +2,15 @@
# Central path constants and config. Source this at the top of every script.
# All paths are relative to the project root.
dotenv::load_dot_env(".env")
suppressPackageStartupMessages({
library(dotenv)
library(tibble)
library(readr)
library(tidyr)
library(dplyr)
})
load_dot_env(".env")
euro_to_dollar_conversion_ratio <- as.numeric(Sys.getenv("euro_to_dollar_conversion_ratio"))
input_cols <- as.integer(Sys.getenv("input_cols"))

View File

@@ -5,8 +5,6 @@
source("scripts/00_paths.R")
library(tibble)
library(readr)
df_income <- tribble(
~id, ~category, ~denomination, ~jan, ~feb, ~mar, ~apr, ~may, ~jun,

View File

@@ -3,7 +3,6 @@
source("scripts/00_paths.R")
library(readr)
df_income <- read_csv(income_raw, show_col_types = FALSE)
df_population <- read_csv(population_raw, show_col_types = FALSE)

View File

@@ -4,8 +4,6 @@
source("scripts/00_paths.R")
library(readr)
library(dplyr)
df <- read_csv(income_raw, show_col_types = FALSE)

View File

@@ -3,8 +3,6 @@
source("scripts/00_paths.R")
library(readr)
library(tidyr)
df <- read_csv(income_usd_wide, show_col_types = FALSE)

View File

@@ -4,9 +4,6 @@
source("scripts/00_paths.R")
library(readr)
library(tidyr)
library(dplyr)
df <- read_csv(population_raw, show_col_types = FALSE)

View File

@@ -3,8 +3,6 @@
source("scripts/00_paths.R")
library(readr)
library(dplyr)
df_income <- read_csv(income_usd, show_col_types = FALSE)
df_pop <- read_csv(population_full, show_col_types = FALSE) |>

View File

@@ -3,8 +3,6 @@
source("scripts/00_paths.R")
library(readr)
library(dplyr)
df_merged <- read_csv(merged, show_col_types = FALSE)

View File

@@ -3,8 +3,6 @@
source("scripts/00_paths.R")
library(readr)
library(dplyr)
df <- read_csv(result, show_col_types = FALSE)