Find all unique non-numeric values
unique_non_numerics(x, na.rm = TRUE, .sort = TRUE)
x | vector to check on |
---|---|
na.rm | remove existing na values before checking |
.sort | sort the results |
This function is especially useful for figuring out what
non-numeric unique values are in in a column that should be numeric
so one can easily replace them with another flag. This function can work well
with replace_char_flags
instead of using nested ifelse statements
replace_values
: to use to replace non-numeric values
in a dataframe.
Other Numerics:
as_numeric()
#> [1] "*" "88 (excluded)" "bql"#> [1] "BQL"#> # A tibble: 2 x 2 #> ID DV #> <int> <chr> #> 1 2 0.5 #> 2 3 9