rapids/src/data/workflow_example/download_demographic_data.R

19 lines
465 B
R
Raw Normal View History

2020-11-25 22:34:05 +01:00
source("renv/activate.R")
library("dplyr", warn.conflicts = F)
library(readr)
library(stringr)
library(yaml)
participant_file <- snakemake@input[["participant_file"]]
2020-11-25 22:34:05 +01:00
sensor_file <- snakemake@output[[1]]
participant <- read_yaml(participant_file)
record_id <- participant$PHONE$LABEL
demographic_data = read.csv(snakemake@input[["data"]])
demographic_data = demographic_data[demographic_data$record_id == record_id, ]
2020-11-25 22:34:05 +01:00
write_csv(demographic_data, sensor_file)