Skip to contents

Creates a data.frame with class rmr_format from an object of class MRInput generated by MendelianRandomization::mr_input.

Usage

mrinput_to_rmr_format(dat)

Arguments

dat

Object from MendelianRandomization::mr_input.

Value

Object of class rmr_format, the RadialMR format

Examples

if (require("MendelianRandomization", quietly = TRUE)) {
dat <- data_radial[data_radial[,10] < 5e-8,]
dat <- MendelianRandomization::mr_input(bx = dat$ldlcbeta,
                                        bxse = dat$ldlcse,
                                        by = dat$chdbeta,
                                        byse = dat$chdse,
                                        snps = dat$rsid)
dat <- mrinput_to_rmr_format(dat)
head(dat)
class(dat)
}
#> [1] "data.frame" "rmr_format"