[{"path":"/articles/Simple REDCap workflow.html","id":"working-with-data-from-redcap","dir":"Articles","previous_headings":"","what":"Working with data from REDCap","title":"Simple REDCap workflow","text":"REDCap excellent tool clinical data acquisition storage. widely used world wide standard tool medical research data Denmark. case analysing data directly whole storing data REDCap, API functionality convenient secure, storing (possibly) sensitive data permanently computer. using “events” “repeated instruments” functionality REDCap, data storage format little confusing work , accustomed tidy data. library(REDCapR) provides simple way working data, however, package just exports data standard format.","code":""},{"path":"/articles/Simple REDCap workflow.html","id":"examples","dir":"Articles","previous_headings":"Working with data from REDCap","what":"Examples","title":"Simple REDCap workflow","text":"","code":"library(REDCapR) # Returns the variables \"record_id\" and \"age\". ds_some_vars <- redcap_read( redcap_uri = \"https://redcap.au.dk/api/\", # This is the address for projects at the AU-server token = \"YOUR_API_KEY_GOES_HERE\", fields = c(\"record_id\", \"age\") )$data # Return only records with IDs of 1 and 4 ds_some_rows <- redcap_read( redcap_uri = \"https://redcap.au.dk/api/\", # This is the address for projects at the AU-server token = \"YOUR_API_KEY_GOES_HERE\", records = c(1, 4) )$data"},{"path":"/articles/Toolbox.html","id":"a-toolbox","dir":"Articles","previous_headings":"","what":"A toolbox","title":"Toolbox","text":"toolbox small workshop mix old, worn, well proven tools newcomers. package seen something like . tried collect tools functions packages use regularly addition functions written fill use cases, able find solutions elsewhere. documenting testing package, used OpenAI’s chatgpt gpttools. chatgpt interesting tool, way perfect, helps tedious tasks. gpttools gptstudio interesting implementations R RStudio.","code":""},{"path":"/articles/Toolbox.html","id":"cpr-intro","dir":"Articles","previous_headings":"A toolbox","what":"CPR manipulations","title":"Toolbox","text":"Note , handled, CPR numbers (social security numbers) handled care considered highly sensitive data. CPR number structured DDMMYY-XXXX, 1st X designating decade birth, last X designate binary gender (biological sex) dependent even/uneven female/male, last digits used modulus calculation verify validity CPR number. Foreigners unidentified persons given temporary CPR numbers including letters. information can found cpr.dk. Note, CPR numbers used examples publicly known non-organic.","code":""},{"path":"/articles/Toolbox.html","id":"age_calc","dir":"Articles","previous_headings":"A toolbox > CPR manipulations","what":"age_calc()","title":"Toolbox","text":"age_calc() function created learning exercise functions similarly lubridate::time_length().","code":"(age <- age_calc(as.Date(\"1945-10-23\"), as.Date(\"2018-09-30\"))) #> [1] 72.93699 trunc(age) #> [1] 72"},{"path":"/articles/Toolbox.html","id":"cpr_check","dir":"Articles","previous_headings":"A toolbox > CPR manipulations","what":"cpr_check()","title":"Toolbox","text":"Checks validity CPR numbers according modulus 11 rule. Note due limitations possible available CPR numbers, rule apply CPR numbers 2007. Including CPR numbers letters gives warning NA, can checked modulus 11 function. used care, see message.","code":"cpr_check( c( \"2310450637\", \"010190-2000\", \"010115-4000\", \"300450-1030\", \"010150-4021\", \"010150-4AA1\" ) ) #> OBS: as per 2007 not all valid CPR numbers apply to modulus 11 rule. #> #> See the vignette 'Toolbox' #> Warning in matrix(as.numeric(unlist(strsplit(cpr_short, \"\"))), nrow = 10): NAs #> introduced by coercion #> [1] TRUE FALSE FALSE FALSE FALSE NA"},{"path":"/articles/Toolbox.html","id":"cpr_dob","dir":"Articles","previous_headings":"A toolbox > CPR manipulations","what":"cpr_dob()","title":"Toolbox","text":"Extractsdatebirth(DOB)CPRnumber.Accountsdecadeb