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"]]
|
2021-03-13 01:52:34 +01:00
|
|
|
|
2020-11-25 22:34:05 +01:00
|
|
|
sensor_file <- snakemake@output[[1]]
|
|
|
|
|
|
|
|
participant <- read_yaml(participant_file)
|
|
|
|
record_id <- participant$PHONE$LABEL
|
|
|
|
|
2021-03-13 01:52:34 +01:00
|
|
|
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
|
|
|
|
2021-03-13 01:52:34 +01:00
|
|
|
write_csv(demographic_data, sensor_file)
|