options(width = 150) knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.align = "center", fig.height = 6, fig.width = 6, out.width = "75%" )
rsimsum
plays nice with the tidyverse.
library(rsimsum) library(dplyr) library(ggplot2) library(knitr)
For instance, it is possible to chain functions using the piping operator %>%
to obtain tables and plots with a single call:
data("MIsim", package = "rsimsum") MIsim %>% simsum(estvarname = "b", se = "se", methodvar = "method", true = 0.5) %>% summary() %>% tidy() %>% kable()
MIsim %>% simsum(estvarname = "b", se = "se", methodvar = "method", true = 0.5) %>% summary() %>% tidy(stats = "bias") %>% ggplot(aes(x = method, y = est, ymin = lower, ymax = upper)) + geom_hline(yintercept = 0, color = "red", lty = "dashed") + geom_point() + geom_errorbar(width = 1 / 3) + theme_bw() + labs(x = "Method", y = "Bias")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.