Skip to content

Commit

Permalink
tips should be move after
Browse files Browse the repository at this point in the history
  • Loading branch information
larmarange committed Oct 14, 2022
1 parent 6a28d42 commit d71236b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 38 deletions.
38 changes: 19 additions & 19 deletions R/ggcoef_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#' @return A `ggplot2` plot or a `tibble` if `return_data = TRUE`.
#' @export
#' @examples
#' library(ggplot2)
#' mod <- lm(Sepal.Length ~ Sepal.Width + Species, data = iris)
#' ggcoef_model(mod)
#'
Expand Down Expand Up @@ -82,24 +81,6 @@
#' "{ifelse(dichotomous, paste0(level, ' / ', reference_level), level)}",
#' show_p_values = FALSE
#' )
#'
#' # works also with with polynomial terms
#' mod_poly <- lm(
#' tip ~ poly(total_bill, 3) + day,
#' data = tips,
#' )
#' ggcoef_model(mod_poly)
#'
#' # or with different type of contrasts
#' # for sum contrasts, the value of the reference term is computed
#' if (requireNamespace("emmeans")) {
#' mod2 <- lm(
#' tip ~ day + time + sex,
#' data = tips,
#' contrasts = list(time = contr.sum, day = contr.treatment(4, base = 3))
#' )
#' ggcoef_model(mod2)
#' }
#' }
#' @examplesIf requireNamespace("reshape")
#'
Expand Down Expand Up @@ -144,7 +125,26 @@
#'
#' # do not display variable facets but add colour guide
#' ggcoef_model(mod_simple, facet_row = NULL, colour_guide = TRUE)
#'
#' # works also with with polynomial terms
#' mod_poly <- lm(
#' tip ~ poly(total_bill, 3) + day,
#' data = tips,
#' )
#' ggcoef_model(mod_poly)
#'
#' # or with different type of contrasts
#' # for sum contrasts, the value of the reference term is computed
#' if (requireNamespace("emmeans")) {
#' mod2 <- lm(
#' tip ~ day + time + sex,
#' data = tips,
#' contrasts = list(time = contr.sum, day = contr.treatment(4, base = 3))
#' )
#' ggcoef_model(mod2)
#' }
#' }
#'
ggcoef_model <- function(
model,
tidy_fun = broom.helpers::tidy_with_broom_or_parameters,
Expand Down
37 changes: 18 additions & 19 deletions man/ggcoef_model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d71236b

Please sign in to comment.