Skip to content

Commit

Permalink
Merge pull request #6 from degauss-org/4.0.1-updates
Browse files Browse the repository at this point in the history
4.0.1 updates
  • Loading branch information
andrew-vancil authored Feb 17, 2022
2 parents 9e71641 + 3982c56 commit c431fd4
Show file tree
Hide file tree
Showing 235 changed files with 2,062 additions and 7,768 deletions.
2 changes: 0 additions & 2 deletions .Rapp.history

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.Rproj.user
.Rproj
.Rhistory
.RData
.Ruserdata
Expand Down
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM rocker/verse:4.0.3
FROM rocker/verse:4.1.2

# install a newer-ish version of renv, but the specific version we want will be restored from the renv lockfile
RUN R --quiet -e "install.packages('renv', repos = 'https://cran.rstudio.com')"
ENV RENV_VERSION 0.15.2
RUN R --quiet -e "remotes::install_github('rstudio/renv@${RENV_VERSION}')"

WORKDIR /app

Expand All @@ -15,13 +17,14 @@ RUN apt-get update \
&& apt-get clean

COPY renv.lock .
RUN R --quiet -e "renv::restore(repos = c(CRAN = 'https://packagemanager.rstudio.com/all/__linux__/focal/latest'))"
#RUN R --quiet -e "renv::restore(repos = c(CRAN = 'https://cran.rstudio.com'))"
#RUN R --quiet -e "renv::restore(repos = c(CRAN = 'https://packagemanager.rstudio.com/all/__linux__/focal/latest'))"
RUN R --quiet -e "renv::restore(repos = c(CRAN = 'https://cran.rstudio.com'))"

COPY tract_to_neighborhood.rds .
COPY ham_neighborhoods_dep_index_shp.rds .
COPY weekly_data_report.R .
COPY entrypoint.R .

WORKDIR /tmp

ENTRYPOINT ["/app/weekly_data_report.R"]
ENTRYPOINT ["/app/entrypoint.R"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build:
docker build -t $(IMAGE) .

test:
docker run --rm -v "${PWD}/test":/tmp $(IMAGE) simulated_jfs_data_geocoded.csv
docker run --rm -v "${PWD}/test":/tmp $(IMAGE) simulated_jfs_data_geocoded_all_years.csv

shell:
docker run --rm -it --entrypoint=/bin/bash -v "${PWD}/test":/tmp $(IMAGE)
Expand Down
17 changes: 4 additions & 13 deletions entrypoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ args <- parse_args(p)
# ALLEGATION_ADDRESS, formatted in a string without punctuation, it includes city, state, and zip code

suppressPackageStartupMessages(library(readr))
suppressPackageStartupMessages(library(tidyverse))
d <- read_csv(args$file_name,
col_types = cols(INTAKE_ID = col_character(),
SCREENING_DECISION = col_character(),
Expand Down Expand Up @@ -44,20 +45,10 @@ d <- read_csv(args$file_name,
))
d <- dplyr::mutate(d, DECISION_DATE = dht::check_dates(DECISION_DATE))

tract_to_neighborhood <- readRDS('/app/tract_to_neighborhood.rds')

message("\nNeighborhood repsonses with < 5 instances have been censored for privacy purposes\n")

rmarkdown::render(input = '/app/aggregate_data_report.rmd',
rmarkdown::render(input = '/app/weekly_data_report.R',
params = list(d = d),
envir = new.env())


# rmarkdown::render(input = '/app/acv_level_report.rmd',
# params = list(d = d),
# envir = new.env(),
# output_file = fs::path("/tmp", paste0(gsub('.csv', '', args$file_name, fixed=TRUE), '_acv_level_report.html')))

# rmarkdown::render(input = '/app/intake_level_report.rmd',
# params = list(d = d),
# envir = new.env(),
# output_file = fs::path("/tmp", paste0(gsub('.csv', '', args$file_name, fixed=TRUE), '_intake_level_report.html')))

18 changes: 0 additions & 18 deletions jfs_report_from_geocoded_file.Rproj

This file was deleted.

Loading

0 comments on commit c431fd4

Please sign in to comment.