Skip to content

Commit

Permalink
Merge pull request #18 from weirichs/catch_asNumericIfPossible_checkmate
Browse files Browse the repository at this point in the history
added checks: catch_asNumericIfPossible
  • Loading branch information
grewered committed Feb 23, 2024
2 parents f06e6e9 + b7605f6 commit af0f135
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/catch_asNumericIfPossible.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@


catch_asNumericIfPossible <- function(x, warn, maintain.factor.scores = TRUE, force.string = TRUE, transform.factors = TRUE) {
checkmate::assert_logical(maintain.factor.scores, len = 1)
checkmate::assert_logical(force.string, len = 1)
checkmate::assert_logical(transform.factors, len = 1)
checkmate::assert_character(warn, len = 1)

y <- tryCatch(asNumericIfPossible(x, maintain.factor.scores = maintain.factor.scores, force.string = force.string,
transform.factors = transform.factors),
warning = function(w) {
Expand Down

0 comments on commit af0f135

Please sign in to comment.