Convert an object of class MRMVInput from the MendelianRandomization package to the RMVMR rmvmr_format class
Source:R/mrmvinput_to_rmvmr_format.R
mrmvinput_to_rmvmr_format.Rd
Creates a data.frame with additional classes rmvmr_format
and mvmr_format
from an object of class MRMVInput
generated by MendelianRandomization::mr_mvinput
.
Arguments
- dat
Object from
MendelianRandomization::mr_mvinput
.
Examples
if (require("MendelianRandomization", quietly = TRUE)) {
bx <- as.matrix(rawdat_rmvmr[,c("ldl_beta", "hdl_beta")])
bxse <- as.matrix(rawdat_rmvmr[,c("ldl_se", "hdl_se")])
dat <- MendelianRandomization::mr_mvinput(bx = bx,
bxse = bxse,
by = rawdat_rmvmr$sbp_beta,
byse = rawdat_rmvmr$sbp_se,
snps = rawdat_rmvmr$snp)
dat <- mrmvinput_to_rmvmr_format(dat)
head(dat)
class(dat)
}
#> [1] "data.frame" "rmvmr_format" "mvmr_format"