Skip to content

Commit

Permalink
improving doc, examples and adding NEWS
Browse files Browse the repository at this point in the history
fix #260
  • Loading branch information
larmarange committed Jul 27, 2024
1 parent 3e5f5b2 commit ae642ca
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

**Fixes**

- `tidy_multgee()` has been fixed to properly identify the different `y.levels`
(#260 @jackmwolf)
- `tidy_marginal_predictions()` has been updated to avoid the use of the
deprecated function `marginaleffects::datagridcf()` (#256)

Expand Down
14 changes: 12 additions & 2 deletions R/custom_tidiers.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,25 @@ tidy_broom <- function(x, ...) {
#' interval in the tidied output
#' @param conf.level the confidence level to use for the confidence interval
#' @param ... additional parameters passed to `parameters::model_parameters()`
#' @details
#' To be noted, for `multgee::nomLORgee()`, the baseline `y` category is the
#' latest modality of `y`.
#'
#' @export
#' @family custom_tieders
#' @examplesIf interactive()
#' if (.assert_package("multgee", boolean = TRUE)) {
#' library(multgee)
#'
#' h <- housing
#' h$status <- factor(
#' h$y,
#' labels = c("street", "community", "independant")
#' )
#'
#' mod <- multgee::nomLORgee(
#' y ~ factor(time) * sec,
#' data = multgee::housing,
#' status ~ factor(time) * sec,
#' data = h,
#' id = id,
#' repeated = time,
#' )
Expand Down
14 changes: 12 additions & 2 deletions man/tidy_multgee.Rd

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

14 changes: 10 additions & 4 deletions tests/testthat/test-tidy_plus_plus.R
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,14 @@ test_that("tidy_plus_plus() works with multgee models", {
skip_if_not_installed("parameters")

library(multgee)
h <- housing
h$status <- factor(
h$y,
labels = c("street", "community", "independant")
)
mod <- multgee::nomLORgee(
y ~ factor(time) * sec,
data = multgee::housing,
status ~ factor(time) * sec,
data = h,
id = id,
repeated = time,
)
Expand All @@ -728,8 +733,9 @@ test_that("tidy_plus_plus() works with multgee models", {
expect_equivalent(
res$y.level,
c(
"0", "0", "0", "0", "0", "0", "0", "0",
"1", "1", "1", "1", "1", "1", "1", "1"
"street", "street", "street", "street", "street", "street",
"street", "street", "community", "community", "community", "community",
"community", "community", "community", "community"
)
)
expect_equivalent(
Expand Down

0 comments on commit ae642ca

Please sign in to comment.