diff --git a/analysis/dataset_definition.py b/analysis/dataset_definition.py index 18824f6..880dccc 100644 --- a/analysis/dataset_definition.py +++ b/analysis/dataset_definition.py @@ -12,3 +12,5 @@ dataset.define_population(has_registration) dataset.sex = patients.sex +dataset.age = patients.age_on(index_date) + diff --git a/analysis/report.R b/analysis/report.R new file mode 100644 index 0000000..f15fc0b --- /dev/null +++ b/analysis/report.R @@ -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"), +) \ No newline at end of file diff --git a/project.yaml b/project.yaml index 0aadb83..852f346 100644 --- a/project.yaml +++ b/project.yaml @@ -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 \ No newline at end of file