Package: rcprd 0.0.1

rcprd: Extraction and Management of Clinical Practice Research Datalink Data

Simplify the process of extracting and processing Clinical Practice Research Datalink (CPRD) data in order to build datasets ready for statistical analysis. This process is difficult in 'R', as the raw data is very large and cannot be read into the R workspace. 'rcprd' utilises 'RSQLite' to create 'SQLite' databases which are stored on the hard disk. These are then queried to extract the required information for a cohort of interest, and create datasets ready for statistical analysis. The processes follow closely that from the 'rEHR' package, see Springate et al., (2017) <doi:10.1371/journal.pone.0171784>.

Authors:Alexander Pate [aut, cre, cph]

rcprd_0.0.1.tar.gz
rcprd_0.0.1.zip(r-4.5)rcprd_0.0.1.zip(r-4.4)rcprd_0.0.1.zip(r-4.3)
rcprd_0.0.1.tgz(r-4.4-any)rcprd_0.0.1.tgz(r-4.3-any)
rcprd_0.0.1.tar.gz(r-4.5-noble)rcprd_0.0.1.tar.gz(r-4.4-noble)
rcprd_0.0.1.tgz(r-4.4-emscripten)rcprd_0.0.1.tgz(r-4.3-emscripten)
rcprd.pdf |rcprd.html
rcprd/json (API)
NEWS

# Install 'rcprd' in R:
install.packages('rcprd', repos = c('https://alexpate30.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/alexpate30/rcprd/issues

On CRAN:

5.45 score 2 stars 5 scripts 6 downloads 18 exports 30 dependencies

Last updated 6 days agofrom:d60e2c38f3. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 15 2024
R-4.5-winOKNov 15 2024
R-4.5-linuxOKNov 15 2024
R-4.4-winOKNov 15 2024
R-4.4-macOKNov 15 2024
R-4.3-winOKNov 15 2024
R-4.3-macOKNov 15 2024

Exports:add_to_databasecombine_querycombine_query_booleanconnect_databasecprd_extractcreate_directory_systemdb_querydelete_directory_systemextract_bmiextract_cholhdl_ratioextract_cohortextract_diabetesextract_hoextract_smokingextract_test_dataextract_test_data_varextract_test_recentextract_time_until

Dependencies:bitbit64blobcachemclicpp11data.tableDBIdplyrfansifastmapfastmatchgenericsgluelifecyclemagrittrmemoisepillarpkgconfigplogrR6rlangRSQLitestringistringrtibbletidyselectutf8vctrswithr

Details-on-algorithms-for-extracting-specific-variables

Rendered fromDetails-on-algorithms-for-extracting-specific-variables.Rmdusingknitr::rmarkdownon Nov 15 2024.

Last update: 2024-11-15
Started: 2024-07-15

rcprd: An R package to simplify the extraction and processing of CPRD data, and create analysis-ready datasets

Rendered fromrcprd.Rmdusingknitr::rmarkdownon Nov 15 2024.

Last update: 2024-11-11
Started: 2024-10-30

Readme and manuals

Help Manual

Help pageTopics
Adds a single .txt file to an SQLite database on the hard disk.add_to_database
Combine a database query with a cohort.combine_query
Combine a database query with a cohort returning a 0/1 vector depending on whether each individual has a recorded code of interest.combine_query_boolean
Combine a CPRD aurum database query with a cohort returning a 0/1 vector depending on whether each individual has a recorded code of interest.combine_query_boolean.aurum
Combine a CPRD aurum database query with a cohort.combine_query.aurum
Open connection to SQLite databaseconnect_database
Adds all the .txt files in a directory, with certain file names, to an SQLite database on the hard disk.cprd_extract
Create the appropriate directory system to be able to run functions without specifying hard filepathscreate_directory_system
Query an RSQLite database.db_query
Deletes directory system created by 'delete_directory_system'delete_directory_system
Extract most recent BMI score relative to an index date.extract_bmi
Extract most recent total cholesterol/high-density lipoprotein ratio score relative to an index date.extract_cholhdl_ratio
Create cohort from patient filesextract_cohort
Extract diabetes status prior to an index date.extract_diabetes
Extract a 'history of' type variableextract_ho
Extract smoking status prior to index date.extract_smoking
Extract test data.extract_test_data
Extract standard deviation of all test data values over a specified time period relative to an index date.extract_test_data_var
Extract test data.extract_test_recent
Extract a 'time until' type variableextract_time_until
Read in txt file with all colClasses = "character"extract_txt_char
Read in raw .txt consultation fileextract_txt_cons
Read in raw ONS death data fileextract_txt_death
Read in raw .txt drugissue fileextract_txt_drug
Read in raw HES primary diagnoses fileextract_txt_hes_primary
Read in linkage eligibility fileextract_txt_linkage
Read in raw .txt observation fileextract_txt_obs
Read in raw .txt patient fileextract_txt_pat
Read in raw .txt problem fileextract_txt_prob
Read in raw .txt referral fileextract_txt_ref
Internal function to implement saving extracted variable to disk or returning into R workspace.implement_output