Convert a data.frame containing a single exposure - outcome pair generated by TwoSampleMR::harmonise_data() to the RadialMR rmr_format class
Source:R/tsmr_to_rmr_format.R
tsmr_to_rmr_format.Rd
Creates an object of RadialMR format, i.e. of class rmr_format
, for a single exposure - outcome pair.
Arguments
- dat
Output for a single exposure-outcome pair from
TwoSampleMR::harmonise_data
.
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)
}
} # }