Skip to content

Commit

Permalink
Generate age histograms
Browse files Browse the repository at this point in the history
  • Loading branch information
atamborska committed Jul 25, 2024
1 parent ea02b59 commit 0877864
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions analysis/dataset_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
dataset.define_population(has_registration)

dataset.sex = patients.sex
dataset.age = patients.age_on(index_date)

13 changes: 13 additions & 0 deletions analysis/report.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
library('tidyverse')

df_input <- read_csv(
here::here("output", "dataset.csv.gz"),
col_types = cols(patient_id = col_integer(),age = col_double())
)

plot_age <- ggplot(data=df_input, aes(df_input$age)) + geom_histogram()

ggsave(
plot= plot_age,
filename="report.png", path=here::here("output"),
)
7 changes: 7 additions & 0 deletions project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ actions:
outputs:
highly_sensitive:
dataset: output/dataset.csv.gz

generate_report:
run: r:latest analysis/report.R
needs: [generate_dataset]
outputs:
moderately_sensitive:
chart: output/report.png

0 comments on commit 0877864

Please sign in to comment.