-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01_pull.R
30 lines (25 loc) · 1.05 KB
/
01_pull.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Pull redcap team registraion
library(tidyverse)
#pull data
hospital_data_orig <- list("token"=Sys.getenv("redcap_token"),
content='record',
action='export',
format='csv',
type='flat',
csvDelimiter='',
rawOrLabel='raw',
rawOrLabelHeaders='raw',
exportCheckboxLabel='true',
exportSurveyFields='false',
exportDataAccessGroups='true',
returnFormat='json',
'forms[0]'='site_survey',
'fields[0]'='data_collection_dag',
'fields[1]'='record_id') %>%
httr::POST(Sys.getenv("redcap_uri"), body = ., encode = "form") %>%
httr::content()
#apply factoring script
data = hospital_data_orig
source("GECKOTeamRegistratio-SiteSurveyDataNeil_R_2024-03-25_1128.r")
hospital_data_orig = data
rm(data)