Skip to content

Commit

Permalink
argentina, fuel
Browse files Browse the repository at this point in the history
  • Loading branch information
ibarraespinosa committed Jul 24, 2024
1 parent 8eb889f commit 6339301
Show file tree
Hide file tree
Showing 112 changed files with 49 additions and 27 deletions.
Binary file modified projects/argentina/config/inventory.xlsx
Binary file not shown.
Binary file modified projects/argentina/estimation/2019.tar.gz
Binary file not shown.
29 changes: 21 additions & 8 deletions projects/argentina/estimation/2019/config/config.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,25 @@ setDT(mileage)
setDT(tfs)
setDT(veh)

setDT(fuel)
setDT(fuel_month)

fuel_month[, date := ISOdate(Year, Month, 1, 0,0,0)]


fuel_month[, consumption_t := FUEL_M3 *density_tm3]

fuel_month[, type := "data"]

pmonth <- fuel_month

fuel_month[, sum(consumption_t),
by = .(region, Year = year(date), fuel, type)
] -> fuel

names(fuel)[ncol(fuel)] <- "consumption_t"

setDT(fuel_spec)
setDT(met)
setDT(pmonth)
setDT(euro)
setDT(tech)

Expand Down Expand Up @@ -168,16 +183,14 @@ switch (language,
"spanish" = cat("Plotando combustible \n"))

p <- ggplot(pmonth,
aes(x = m,
y = as.numeric(m3),
aes(x = month(date),
y = as.numeric(FUEL_M3),
fill = fuel)) +
geom_bar(stat = "identity") +
labs(y = "m3") +
facet_wrap(~ region,
scales = "free_y") +
facet_wrap(~ region) +
theme_bw(base_size = 16) +
theme(legend.position = c(0.8, 0.05),
legend.direction="horizontal")
theme(panel.spacing = unit(0,'lines'))

png("images/FUEL.png",
width = 3000,
Expand Down
Binary file removed projects/argentina/estimation/2019/config/euro.rds
Binary file not shown.
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/config/fuel.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/config/fuel_spec.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/config/im_co.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/config/im_hc.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/config/im_nox.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/config/im_ok.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/config/im_pm.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/config/met.rds
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/config/s.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/config/tech.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/config/tfs.rds
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/images/FUEL.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/images/S_BUS.png
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/images/S_LCV.png
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/images/S_MC.png
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/images/S_PC.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/images/TFS_MC.png
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/images/TFS_PC.png
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Brazil by state 2019

Directory: /media/sergio/ext4/models/vein/projects/argentina/estimation/2019

Local Time: 2024-07-11 20:43:42.214292
Local Time: 2024-07-23 22:21:50.124448
Inventory compiler: sergio
========================================

sysname = Linux
release = 6.8.0-36-generic
version = #36-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 10 10:49:14 UTC 2024
release = 6.8.0-38-generic
version = #38-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 7 15:25:01 UTC 2024
nodename = sergio-gl639sd
machine = x86_64
user = sergio
Expand Down Expand Up @@ -60,9 +60,10 @@ BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.12.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

time zone: America/Denver
tzcode source: system (glibc)
Expand All @@ -71,18 +72,21 @@ attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] eixport_0.6.0 stars_0.6-4 abind_1.4-5 units_0.8-5 data.table_1.15.4 ggplot2_3.5.1
[7] cptcity_1.0.6 sf_1.0-16 vein_1.1.3
[1] eixport_0.6.0 stars_0.6-4 abind_1.4-5 units_0.8-5 data.table_1.15.4
[6] ggplot2_3.5.1 cptcity_1.0.6 sf_1.0-16 vein_1.1.3

loaded via a namespace (and not attached):
[1] utf8_1.2.4 generics_0.1.3 class_7.3-22 KernSmooth_2.23-22 lattice_0.22-5 magrittr_2.0.3
[7] grid_4.3.3 cellranger_1.1.0 e1071_1.7-14 DBI_1.2.3 fansi_1.0.6 scales_1.3.0
[13] codetools_0.2-19 cli_3.6.3 rlang_1.1.4 crayon_1.5.2 munsell_0.5.0 withr_3.0.0
[19] tools_4.3.3 raster_3.6-26 parallel_4.3.3 dplyr_1.1.4 colorspace_2.1-0 ncdf4_1.22
[25] vctrs_0.6.5 R6_2.5.1 proxy_0.4-27 lifecycle_1.0.4 classInt_0.4-10 pkgconfig_2.0.3
[31] terra_1.7-78 pillar_1.9.0 gtable_0.3.4 glue_1.7.0 Rcpp_1.0.12 tibble_3.2.1
[37] tidyselect_1.2.0 farver_2.1.1 labeling_0.4.3 dotCall64_1.1-1 compiler_4.3.3 readxl_1.4.3
[43] sp_2.1-3
[1] utf8_1.2.4 generics_0.1.3 class_7.3-22 KernSmooth_2.23-22
[5] lattice_0.22-5 magrittr_2.0.3 grid_4.3.3 cellranger_1.1.0
[9] e1071_1.7-14 DBI_1.2.3 fansi_1.0.6 scales_1.3.0
[13] codetools_0.2-19 cli_3.6.3 rlang_1.1.4 crayon_1.5.2
[17] munsell_0.5.0 withr_3.0.0 tools_4.3.3 raster_3.6-26
[21] parallel_4.3.3 dplyr_1.1.4 colorspace_2.1-0 ncdf4_1.22
[25] vctrs_0.6.5 R6_2.5.1 proxy_0.4-27 lifecycle_1.0.4
[29] classInt_0.4-10 pkgconfig_2.0.3 terra_1.7-78 pillar_1.9.0
[33] gtable_0.3.4 glue_1.7.0 Rcpp_1.0.12 tibble_3.2.1
[37] tidyselect_1.2.0 farver_2.1.1 labeling_0.4.3 dotCall64_1.1-1
[41] compiler_4.3.3 readxl_1.4.3 sp_2.1-3

========================================

Expand Down
11 changes: 8 additions & 3 deletions projects/argentina/estimation/2019/scripts/main_01_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ metadata <- readxl::read_xlsx(path = path, sheet = "metadata")
mileage <- readRDS("../../config/rds/mileage.rds")
tfs <- readxl::read_xlsx(path = path, sheet = "tfs")

s <- readxl::read_xlsx(path = path, sheet = "s")

veh <- readRDS("../../config/rds/fleet_age.rds")
fuel <- readRDS("../../config/rds/fuel.rds")

# assuming fuel 2019
fuel_month <- readxl::read_xlsx(path = path, sheet = "fuel_month")
# columns used: date, FUEL_M3, density_tm3, type, fuel
fuel_month$Year <- 2019
s <- readxl::read_xlsx(path = path, sheet = "s")
fuel_spec <- readxl::read_xlsx(path = path, sheet = "fuel_spec")
pmonth <- readRDS("../../config/rds/fuel_month.rds")

met <- readRDS("../../config/rds/met.rds")

euro <- readxl::read_xlsx(path = path, sheet = "euro")
Expand All @@ -41,6 +45,7 @@ im_hc <- readxl::read_xlsx(path = path, sheet = "im_hc")
im_nox <- readxl::read_xlsx(path = path, sheet = "im_nox")
im_pm <- readxl::read_xlsx(path = path, sheet = "im_pm25")


source("config/config.R")

rm(list = ls())
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/BUS_ELEC.rds
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/BUS_UB_15_D.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/BUS_UB_15_G.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/BUS_UB_15_HY.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/BUS_UB_18_D.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/BUS_UB_18_G.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/LCV_ELEC.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/LCV_HY.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/LCV_NIII_D.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/LCV_NIII_G.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/LCV_NII_D.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/LCV_NII_G.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/LCV_NI_D.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/LCV_NI_G.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/MC_2S_50_G.rds
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/MC_4S_750_G.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/MC_ELEC.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/PC_ELEC.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/PC_MEDIUM_D.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/PC_MEDIUM_G.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/PC_MINI_D.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/PC_MINI_G.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/PC_SMALL_D.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/PC_SMALL_G.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/PC_SMALL_HY.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/PC_SUV_D.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/PC_SUV_G.rds
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/TAXI_SMALL_G.rds
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed projects/argentina/estimation/2019/veh/TRUCKS_ELEC.rds
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 6339301

Please sign in to comment.