Skip to contents

Creates an object of RadialMR format, i.e. of class rmr_format, for a single exposure - outcome pair.

Usage

tsmr_to_rmr_format(dat)

Arguments

dat

Output for a single exposure-outcome pair from TwoSampleMR::harmonise_data.

Value

Object of class rmr_format, the RadialMR format

Details

Only the rows where the column mr_keep are TRUE are kept.

Examples

if (FALSE) { # \dontrun{
if (require("TwoSampleMR", quietly = TRUE)) {
  # Example with one exposure-outcome pair
  bmi_exp_dat <- TwoSampleMR::extract_instruments(outcomes = 'ieu-a-2')
  chd_out_dat <- TwoSampleMR::extract_outcome_data(
    snps = bmi_exp_dat$SNP,
    outcomes = 'ieu-a-7'
  )
dat <- TwoSampleMR::harmonise_data(exposure_dat = bmi_exp_dat,
                                   outcome_dat = chd_out_dat)
dat <- tsmr_to_rmr_format(dat)
class(dat)
head(dat)
}
} # }