NOTE: THIS PROJECT HAS BEEN ABANDONED
This project aims to examine the association between eGFR, CVD and mortality in the general population, and examine whether this potential association is causal by employing the MR approach.
If dependencies have been managed by using
usethis::use_package("packagename")
through the DESCRIPTION
file,
installing dependencies is as easy as opening the .Rproj
file and
running this command in the console:
pak::pak()
The data-raw/
folder contains the scripts to select, process, and
prepare the data on the RAP to eventually be downloaded.
The steps to take to select the variables you want, create the CSV file on the RAP, convert it to Parquet format (for faster loading), and download to your project on RAP. The order is:
- Select the variables you want in
data-raw/project-variables.csv
. - Follow the instructions in the
data-raw/create-data.R
script and run it to create the CSV file on the RAP server. - Open the
_targets.R
and change thedownload_project_data
target intar_target()
line from"parquet"
to"csv"
. Then runtargets::tar_make()
to download the CSV file todata/
. RESTART SESSION - Open and run the
data-raw/convert-to-parquet.R
script to convert the CSV file to the Parquet format. - Go back into
_targets.R
and change the"csv"
to"parquet"
(the opposite of what was done in item 3). Runtargets::tar_make()
in the Console to download the Parquet file and store in thedata/
folder.
It is very timely to rerun all code every time you have made changes in the data, so you can save and reload your work along the way by following the layout in "data-raw/processing.r" script. This is also helpful to do, when you have completed all data management tasks and want to save your changes to have a "ready to go" data frame to run your analysis on.
After having completed the data management and running the processing.R script, you can start doing descriptive and comparative analyses of your data.
The following folders contain:
-
data/
: Will contain the UK Biobank data (not saved to Git) as well as the intermediate results output files. -
data-raw/
: Contains the R script to download the data, as well as the CSV files that contain the project variables and the variable list as named in the RAP. -
doc/
: This file contains the R Markdown, Word, or other types of documents with written content, like the manuscript and protocol. -
R/
: Contains the R scripts and functions to create the figures, tables, and results for the project.