Skip to content

Commit

Permalink
Incorporate IV exclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
bgcarlisle committed Aug 11, 2021
1 parent 3883785 commit 3422a67
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*~
data/*
data/*
*.rds
35 changes: 28 additions & 7 deletions prep/transform-intovalue.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
library(tidyverse)

## Generate this CSV using the script here:
## https://github.com/maia-sh/intovalue-data/blob/main/R/05_prepare-clinical-dashboard-data.R
iv_umc <- read_csv(
"../shiny_app/data/ct-dashboard-intovalue-umc.csv"
)
## Get intovalue.rds from here:

This comment has been minimized.

Copy link
@maia-sh

maia-sh Aug 11, 2021

Collaborator

@bgcarlisle intovalue-data should be public so you should be able to script the reading in of the data and saving to the prep folder. readr::read_rds gives me some issues with urls, but rio::import should work, i.e., `rio::import("https://github.com/maia-sh/intovalue-data/blob/main/data/processed/intovalue.rds")

This comment has been minimized.

Copy link
@maia-sh
## https://github.com/maia-sh/intovalue-data/blob/main/data/processed/intovalue.rds
## Save it in the prep/ folder in this repo

intovalue <- read_rds("intovalue.rds")

## Apply the IntoValue exclusion criteria
intovalue <- intovalue %>%
filter(
iv_completion,
iv_status,
iv_interventional,
has_german_umc_lead,
## In case of dupes, exclude IV1 version
!(is_dupe & iv_version == 1)
)

iv_all <- intovalue

## Un-nest the cities
iv_umc <- intovalue %>%
mutate(lead_cities = strsplit(as.character(lead_cities), " ")) %>%
tidyr::unnest(lead_cities)

## This is the library of transformations
transforms <- read_csv("intovalue-city-transforms.csv")
Expand All @@ -13,6 +31,9 @@ transforms <- read_csv("intovalue-city-transforms.csv")
iv_umc <- iv_umc %>%
left_join(transforms)

## This writes the final CSV out
## This writes the final CSVs out
iv_all %>%
write_csv("../data/ct-dashboard-intovalue-all.csv")

iv_umc %>%
write_csv("../shiny_app/data/ct-dashboard-intovalue-umc.csv")
write_csv("../data/ct-dashboard-intovalue-umc.csv")

0 comments on commit 3422a67

Please sign in to comment.