Convert an object of class MRInput from the MendelianRandomization package to the mrbayes mr_format class
Source:R/mrinput_mrformat.R
mrinput_mr_format.Rd
Creates a data.frame with class mr_format
from an object of class MRInput
generated by MendelianRandomization::mr_input
.
Arguments
- dat
Object from
MendelianRandomization::mr_input
.
Examples
if (requireNamespace("MendelianRandomization", quietly = TRUE)) {
dat <- MendelianRandomization::mr_input(
bx = bmi_insulin$beta.exposure,
bxse = bmi_insulin$se.exposure,
by = bmi_insulin$beta.outcome,
byse = bmi_insulin$se.outcome,
snps = bmi_insulin$rsid
)
dat <- mrinput_mr_format(dat)
head(dat)
class(dat)
}
#> [1] "data.frame" "mr_format"