mrinput_mr_format: Convert an object of class MRInput from the...

View source: R/mrinput_mrformat.R

mrinput_mr_formatR Documentation

Convert an object of class MRInput from the MendelianRandomization package to the mrbayes mr_format class

Description

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

Usage

mrinput_mr_format(dat)

Arguments

dat

Object from MendelianRandomization::mr_input.

Value

Object of class mr_format, the mrbayes format

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)
}

mrbayes documentation built on Sept. 11, 2024, 6:45 p.m.