-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3883785
commit 3422a67
Showing
2 changed files
with
30 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*~ | ||
data/* | ||
data/* | ||
*.rds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
maia-sh
Collaborator
|
||
## 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") | ||
|
@@ -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") |
@bgcarlisle
intovalue-data
should be public so you should be able to script the reading in of the data and saving to theprep
folder.readr::read_rds
gives me some issues with urls, butrio::import
should work, i.e., `rio::import("https://github.com/maia-sh/intovalue-data/blob/main/data/processed/intovalue.rds")