Description Usage Arguments Value Examples
Talk to Group a Data set
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | talk_regress(.data, cmd, tidy = TRUE, verbose = FALSE, ...)
talk_regress_links()
talk_regress_families()
talk_regress_expr(
data_colnames,
cmd,
allowed_words = c("condition", talk_regress_links(), talk_regress_families()),
...
)
talk_process_regress_cmd(cmd)
|
.data |
The data set/ |
cmd |
Command to perform on the data set. |
tidy |
should |
verbose |
print diagnostic output |
... |
additional arguments to pass to |
data_colnames |
column names of the data |
allowed_words |
words allowed to be in the command other than the column names |
A data.frame
or list of them if length(cmds) > 1
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | library(tibble)
library(dplyr)
df = mtcars %>%
rownames_to_column(var = "car")
cmds = c(
"regress mpg on cyl and hp",
"regress mpg on cyl and hp columns 4",
"regress mpg on cyl and hp and column 6",
"regress am on hp and column 6 on mpg binomial",
"regress am on hp and column 6 on mpg binomial logit link"
)
data_colnames = df
.data = df
results = lapply(cmds, talk_regress, .data = df)
cmd = "regress mpg on cyl and hp and column 6 poisson"
mod_1 = talk_regress(.data, cmd)
cmd = "regress poisson cyl and hp and column 6 on mpg"
mod_2 = talk_regress(.data, cmd)
testthat::expect_equal(coef(mod_1), coef(mod_2))
cmd = "regress poisson cyl and hp and column 6 on mpg"
mod_2 = talk_regress(.data, cmd, exponentiate = TRUE)
cmd = "regress am on hp and column 6 and mpg binomial"
#'
cmd = "regress columns 2 and 5, mpg decreasing"
testthat::expect_error(talk_regress(.data, cmd),
"y variable")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.