Yossi's attempt to encapsulate the environment and functions needed to prepare data for, and use the R library TwoSampleMR
This repository contains three main components:
utils.R
file There are three options:
1. Install the R library TwoSampleMR and some others on your own, and simply use the methods in utils.R
2. Use the scripts in the [installation] directory (they are numbered, run them in order)
3. Run inside the docker container richardslab/mr_utils
docker run --rm -it -v $(pwd):/work richardslab/mr_utils:latest Rscript /work/relative/path/to/r/file -arg1 value1 -arg2 value2
To use in a separate project, you should create a directory for yuor new project, copy the files renv.lock
and .Rprofile
(named default.Profile
in the release, you'll have to rename it) from the MR repository (or thr release) to your directory, and copy renv/activate.R
into a directory renv/
in your project directory.
Next, start R while in that directory (or Rstudio). renv should install itself and then you should install all the required packages using renv::restore()
(within that R session).
Finally, you can now install MRutils by installing the zip using install.packages("MRutils_xxx.xxx.xx")
If all concluded successfully, you should now have MRutils installed and ready to go!
In order to get Rstudio to "see" your conda environment you'll need to invoke it from within that environment. here's how to do it on a mac:
cd MRutils
conda activate MRutils
export RSTUDIO_WHICH_R=`which R` ## this should be done
open -a RStudio
This is work in progress. please visit often.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.