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

Remove the internal utility .to_numeric()? #206

Closed
IndrajeetPatil opened this issue Aug 20, 2022 · 1 comment · Fixed by #358
Closed

Remove the internal utility .to_numeric()? #206

IndrajeetPatil opened this issue Aug 20, 2022 · 1 comment · Fixed by #358
Assignees

Comments

@IndrajeetPatil
Copy link
Member

Following discussion in easystats/datawizard#206,

modelbased/R/utils.R

Lines 1 to 8 in 005e2ba

#' @keywords internal
#' @noRd
.to_numeric <- function(x) {
tryCatch(as.numeric(as.character(x)),
error = function(e) x,
warning = function(w) x
)
}

@DominiqueMakowski
Copy link
Member

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

This is the only place where we use it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants