Skip to content

Commit

Permalink
add support
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Feb 22, 2024
1 parent 3649723 commit 9bcc8f7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: parameters
Title: Processing of Model Parameters
Version: 0.21.5.1
Version: 0.21.5.2
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# parameters 0.21.6

## New supported models

* Support for models of class `serp` (*serp*).

## Bug fixes

* Fixed issue with parameter names for `model_parameters()` and objects from
Expand Down
10 changes: 9 additions & 1 deletion R/format_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,15 @@ format_parameters.parameters_model <- function(model, ...) {

if (types$Type[i] %in% c("interaction", "nested", "simple")) {
# Interaction or nesting
components <- unlist(strsplit(name, ":", fixed = TRUE), use.names = FALSE)

# for "serp" models, coefficients end with ":1", ":2", etc. - we need
# to take this into account when splitting the name into components.
if (inherits(model, "serp")) {
pattern <- "(:(?![0-9]+$))"
components <- unlist(strsplit(name, pattern, perl = TRUE), use.names = FALSE)
} else {
components <- unlist(strsplit(name, ":", fixed = TRUE), use.names = FALSE)
}
is_nested <- types$Type[i] == "nested"
is_simple <- types$Type[i] == "simple"

Expand Down

0 comments on commit 9bcc8f7

Please sign in to comment.