Skip to content

Commit

Permalink
Remove the internal utility .to_numeric()? (#358)
Browse files Browse the repository at this point in the history
Fixes #206
  • Loading branch information
strengejacke authored Jan 19, 2025
1 parent 87c72f9 commit 36f85e9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion R/estimate_grouplevel.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ estimate_grouplevel <- function(model, type = "random", ...) {
random <- random[c("Group", "Level", names(random)[!names(random) %in% c("Group", "Level")])]

# Sort
random <- random[order(random$Group, .to_numeric(random$Level), random$Parameter), ]
random <- random[order(random$Group, datawizard::coerce_to_numeric(random$Level), random$Parameter), ]

# Clean
row.names(random) <- NULL
Expand Down
10 changes: 0 additions & 10 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
#' @keywords internal
#' @noRd
.to_numeric <- function(x) {
tryCatch(as.numeric(as.character(x)),
error = function(e) x,
warning = function(w) x
)
}


#' @keywords internal
#' @noRd
.brms_aux_elements <- function() {
Expand Down

0 comments on commit 36f85e9

Please sign in to comment.