Skip to content

Commit 38a93b7

Browse files
authored
Merge pull request #266 from easystats/rc_0_8_9
Prepare CRAN release
2 parents a690f60 + d20353a commit 38a93b7

5 files changed

+22
-22
lines changed

DESCRIPTION

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
Type: Package
22
Package: modelbased
33
Title: Estimation of Model-Based Predictions, Contrasts and Means
4-
Version: 0.8.8.1
4+
Version: 0.8.9
55
Authors@R:
66
c(person(given = "Dominique",
77
family = "Makowski",
88
role = c("aut", "cre"),
99
email = "[email protected]",
10-
comment = c(ORCID = "0000-0001-5375-9967", Twitter = "@Dom_Makowski")),
10+
comment = c(ORCID = "0000-0001-5375-9967")),
1111
person(given = "Daniel",
1212
family = "Lüdecke",
1313
role = "aut",
1414
email = "[email protected]",
15-
comment = c(ORCID = "0000-0002-8895-3206", Twitter = "@strengejacke")),
15+
comment = c(ORCID = "0000-0002-8895-3206")),
1616
person(given = "Mattan S.",
1717
family = "Ben-Shachar",
1818
role = "aut",
1919
email = "[email protected]",
20-
comment = c(ORCID = "0000-0002-4287-4801", Twitter = "@mattansb")),
20+
comment = c(ORCID = "0000-0002-4287-4801")),
2121
person(given = "Indrajeet",
2222
family = "Patil",
2323
role = "aut",
2424
email = "[email protected]",
25-
comment = c(ORCID = "0000-0003-1995-6531", Twitter = "@patilindrajeets")))
25+
comment = c(ORCID = "0000-0003-1995-6531")))
2626
Maintainer: Dominique Makowski <[email protected]>
2727
Description: Implements a general interface for model-based estimations
2828
for a wide variety of models, used in the computation of
@@ -69,7 +69,7 @@ VignetteBuilder:
6969
knitr
7070
Encoding: UTF-8
7171
Language: en-US
72-
RoxygenNote: 7.3.1
72+
RoxygenNote: 7.3.2
7373
Config/testthat/edition: 3
7474
Config/testthat/parallel: true
7575
Roxygen: list(markdown = TRUE)

R/estimate_contrasts.R

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
#'
1515
#' @inherit estimate_slopes details
1616
#'
17-
#' @examplesIf require("emmeans", quietly = TRUE)
17+
#' @examplesIf require("lme4", quietly = TRUE) && require("emmeans", quietly = TRUE) && require("rstanarm", quietly = TRUE)
18+
#' \dontrun{
1819
#' # Basic usage
1920
#' model <- lm(Sepal.Width ~ Species, data = iris)
2021
#' estimate_contrasts(model)
@@ -44,18 +45,15 @@
4445
#' estimated <- estimate_contrasts(lm(Sepal.Width ~ Species, data = iris))
4546
#' standardize(estimated)
4647
#'
47-
#' @examplesIf require("lme4", quietly = TRUE) && require("emmeans", quietly = TRUE)
4848
#' # Other models (mixed, Bayesian, ...)
4949
#' data <- iris
5050
#' data$Petal.Length_factor <- ifelse(data$Petal.Length < 4.2, "A", "B")
5151
#'
5252
#' model <- lme4::lmer(Sepal.Width ~ Species + (1 | Petal.Length_factor), data = data)
5353
#' estimate_contrasts(model)
5454
#'
55-
#' @examplesIf require("rstanarm", quietly = TRUE) && require("emmeans", quietly = TRUE)
5655
#' library(rstanarm)
5756
#'
58-
#' \donttest{
5957
#' data <- mtcars
6058
#' data$cyl <- as.factor(data$cyl)
6159
#' data$am <- as.factor(data$am)

R/estimate_slopes.R

+6-2
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,12 @@ estimate_slopes <- function(model,
122122
if (insight::model_info(model)$is_bayesian) {
123123
trends <- parameters::parameters(estimated, ci = ci, ...)
124124
trends <- .clean_names_bayesian(trends, model, transform = "none", type = "trend")
125-
trends <- cbind(estimated@grid, trends)
126-
trends[[".wgt."]] <- NULL # Drop the weight column
125+
em_grid <- as.data.frame(estimated@grid)
126+
em_grid[[".wgt."]] <- NULL # Drop the weight column
127+
colums_to_add <- setdiff(colnames(em_grid), colnames(trends))
128+
if (length(colums_to_add)) {
129+
trends <- cbind(em_grid[colums_to_add], trends)
130+
}
127131
} else {
128132
trends <- parameters::parameters(estimated, ci = ci, ...)
129133
}

man/estimate_contrasts.Rd

+4-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/modelbased-package.Rd

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)