devtools::install_github('artichaud1/twoway')
library(dplyr)
library(twoway)
data <- data_frame(
x = runif(1000),
g1 = sample(c('a', 'b'), 1000, replace = TRUE),
g2 = sample(c('U', 'V'), 1000, replace = TRUE),
g3 = sample(c('G3_1', 'G3_2'), 1000, replace = TRUE),
y = runif(1000),
w = sample(1:5, 1000, replace = TRUE),
e = sample(1:2, 1000, replace = TRUE)
)
twoway(data,
target = 'y',
var = 'g1',
var2 = 'g2',
weight = 'w',
exposure = 'e') %>%
show(title = 'Example 1')
twoway(data,
target = 'y',
var = 'g1',
var2 = 'x',
weight = 'w',
exposure = 'e',
quantiles2 = 3,
labels2 = paste('x:', c('low', 'medium', 'high'))) %>%
show(title = 'Example 2')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.