Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare CRAN release #266

Merged
merged 6 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
Type: Package
Package: modelbased
Title: Estimation of Model-Based Predictions, Contrasts and Means
Version: 0.8.8.1
Version: 0.8.9
Authors@R:
c(person(given = "Dominique",
family = "Makowski",
role = c("aut", "cre"),
email = "[email protected]",
comment = c(ORCID = "0000-0001-5375-9967", Twitter = "@Dom_Makowski")),
comment = c(ORCID = "0000-0001-5375-9967")),
person(given = "Daniel",
family = "Lüdecke",
role = "aut",
email = "[email protected]",
comment = c(ORCID = "0000-0002-8895-3206", Twitter = "@strengejacke")),
comment = c(ORCID = "0000-0002-8895-3206")),
person(given = "Mattan S.",
family = "Ben-Shachar",
role = "aut",
email = "[email protected]",
comment = c(ORCID = "0000-0002-4287-4801", Twitter = "@mattansb")),
comment = c(ORCID = "0000-0002-4287-4801")),
person(given = "Indrajeet",
family = "Patil",
role = "aut",
email = "[email protected]",
comment = c(ORCID = "0000-0003-1995-6531", Twitter = "@patilindrajeets")))
comment = c(ORCID = "0000-0003-1995-6531")))
Maintainer: Dominique Makowski <[email protected]>
Description: Implements a general interface for model-based estimations
for a wide variety of models, used in the computation of
Expand Down Expand Up @@ -69,7 +69,7 @@ VignetteBuilder:
knitr
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Config/testthat/edition: 3
Config/testthat/parallel: true
Roxygen: list(markdown = TRUE)
Expand Down
6 changes: 2 additions & 4 deletions R/estimate_contrasts.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#'
#' @inherit estimate_slopes details
#'
#' @examplesIf require("emmeans", quietly = TRUE)
#' @examplesIf require("lme4", quietly = TRUE) && require("emmeans", quietly = TRUE) && require("rstanarm", quietly = TRUE)

Check warning on line 17 in R/estimate_contrasts.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/estimate_contrasts.R,line=17,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 123 characters.

Check warning on line 17 in R/estimate_contrasts.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/estimate_contrasts.R,line=17,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 123 characters.
#' \dontrun{
#' # Basic usage
#' model <- lm(Sepal.Width ~ Species, data = iris)
#' estimate_contrasts(model)
Expand Down Expand Up @@ -44,18 +45,15 @@
#' estimated <- estimate_contrasts(lm(Sepal.Width ~ Species, data = iris))
#' standardize(estimated)
#'
#' @examplesIf require("lme4", quietly = TRUE) && require("emmeans", quietly = TRUE)
#' # Other models (mixed, Bayesian, ...)
#' data <- iris
#' data$Petal.Length_factor <- ifelse(data$Petal.Length < 4.2, "A", "B")
#'
#' model <- lme4::lmer(Sepal.Width ~ Species + (1 | Petal.Length_factor), data = data)
#' estimate_contrasts(model)
#'
#' @examplesIf require("rstanarm", quietly = TRUE) && require("emmeans", quietly = TRUE)
#' library(rstanarm)
#'
#' \donttest{
#' data <- mtcars
#' data$cyl <- as.factor(data$cyl)
#' data$am <- as.factor(data$am)
Expand Down
8 changes: 6 additions & 2 deletions R/estimate_slopes.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,12 @@
if (insight::model_info(model)$is_bayesian) {
trends <- parameters::parameters(estimated, ci = ci, ...)
trends <- .clean_names_bayesian(trends, model, transform = "none", type = "trend")
trends <- cbind(estimated@grid, trends)
trends[[".wgt."]] <- NULL # Drop the weight column
em_grid <- as.data.frame(estimated@grid)
em_grid[[".wgt."]] <- NULL # Drop the weight column
colums_to_add <- setdiff(colnames(em_grid), colnames(trends))
if (length(colums_to_add)) {
trends <- cbind(em_grid[colums_to_add], trends)
}
} else {
trends <- parameters::parameters(estimated, ci = ci, ...)
}
Expand Down Expand Up @@ -209,7 +213,7 @@
ends <- nrow(data)
# Iterate through all rows to find blocks
for (i in 2:nrow(data)) {
if ((data$Confidence[i] != sig) || ((centrality_signs[i] != centrality_sign) && data$Confidence[i] == "Uncertain")) {

Check warning on line 216 in R/estimate_slopes.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/estimate_slopes.R,line=216,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 121 characters.

Check warning on line 216 in R/estimate_slopes.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/estimate_slopes.R,line=216,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 121 characters.
centrality_sign <- centrality_signs[i]
sig <- data$Confidence[i]
starts <- c(starts, i)
Expand Down
10 changes: 4 additions & 6 deletions man/estimate_contrasts.Rd

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

8 changes: 4 additions & 4 deletions man/modelbased-package.Rd

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

Loading