Skip to content

Commit

Permalink
Adjust paths to write in different directories seats and percentage o…
Browse files Browse the repository at this point in the history
…utputs (#81)

Co-authored-by: Teresa Ortiz <tereom@mbook-fg.local>
  • Loading branch information
tereom and Teresa Ortiz authored May 5, 2024
1 parent add4b34 commit b5903cb
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions R/process_election_day_ratio_diputados.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ write_results_ratio_diputados <- function(df, file_name, team, path_out, path_ma
relocate(c(EQ,EN,R), .before = everything()) |>
relocate(c(LMU), .after = last_col())

readr::write_csv(tab_seats_candidatos, paste0(path_out, "/", team, 'dip',
EN, R, ".csv"))
# path_out must be set to opt/cotecora
path_seats <- paste0(path_out, "/buzon_diputados_escano/equipo2dip")
if(dir.exists(path_seats)) {
readr::write_csv(tab_seats_candidatos, paste0(path_seats, "/", team, 'dip',
EN, R, ".csv"))
}

readr::write_csv(tab_seats_candidatos, paste0(path_mailbox, "/", team, 'dip',
EN, R, ".csv"))

Expand Down Expand Up @@ -56,11 +61,14 @@ write_results_ratio_diputados <- function(df, file_name, team, path_out, path_ma
relocate(c(EQ,EN,R), .before = everything()) |>
relocate(c(PART, LMU), .after = last_col())

readr::write_csv(tab_prop_candidatos, paste0(path_out, "/", team,
EN, R, ".csv"))
path_percent <- paste0(path_out, "/buzon_diputados/equipo2")
if(dir.exists(path_percent)) {
readr::write_csv(tab_prop_candidatos, paste0(path_percent, "/", team,
EN, R, ".csv"))
}

readr::write_csv(tab_prop_candidatos, paste0(path_mailbox, "/", team,
EN, R, ".csv"))

}

#' Automatically process batch of new data, and write estimates in correct
Expand Down

0 comments on commit b5903cb

Please sign in to comment.