addBP: Adding blood pressure data to your final file

Description Usage Arguments Details Value Examples

View source: R/addVariables.R

Description

This function takes your dataset (crea.rep or similar) and finds blood pressure information on each patient in crea dataset. It is up to you which ReadCode you want to analyse. You can only analyse full ReadCode (not the ones that only begin with some string). This function also adds Flag column to the final data set. If the BP measure is more than 30 days old, the Flag column for this patient's event.date will have TRUE.

Usage

1
addBP(crea.datasett, bpdata = bpdata, BPReadCode, NbOfCores = 4L, filename)

Arguments

crea.datasett

dataset with creatinine ReadCodes, at least three creatinine measurements per patient.

bpdata

blood pressure data filtered out from SIR data or similar. It has to be clean data, no NA, no duplicates. Has to contain ReadCodes for blood pressure type, event.date of blood pressure measurement and patient ID.

BPReadCode

blood pressure ReadCode, character vector of length one (see examples).

NbOfCores

how much cores do you want to use for your parallel process? Will be added to getOption() from mclapply. Default is 4.

filename

name of the final .txt file your output will be saved to. Can be a path also. Should be a txt file because of write.table function inside.

Details

This function uses lapply, not mclapply. Even more recommended to run it in the background or on cluster. The column used for time analysis is named "event.date".

Value

This function returns out file of lapply function. Can be useful to save the output to a file in case an error occurrs. You can find error details in that output file. The creatinine data with diabetes is automatically saved to a .txt file, row by row, and can later be accessed by using "read.table" function.

Examples

1
2
3
4
## Not run: 
addBP(crea.dataset, bpdata, BPReadCode=c("246A."), filename="creaWithDiabetes.txt")

## End(Not run)

dkurtoic/addVariables documentation built on May 30, 2019, 8:28 a.m.