Convert an object of class MRInput from the MendelianRandomization package to the RadialMR rmr_format class
Source:R/mrinput_to_rmr_format.R
mrinput_to_rmr_format.Rd
Creates a data.frame with class rmr_format
from an object of class MRInput
generated by MendelianRandomization::mr_input
.
Arguments
- dat
Object from
MendelianRandomization::mr_input
.
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"