We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
worth a thought?? in line with between. and str_trim. below also would return any NA's
between
str_trim
trim <- function(x, left, right) { # test if value is a number # ... if(missing(left)) left = min(x, na.rm = TRUE) if(missing(right)) right = max(x, na.rm = TRUE) x <- ifelse(x < left, left, x) x <- ifelse(x > right, right, x) return(x) } # example data_frame(x = c(1:10, NA)) %>% mutate(x1 = trim(x, 4, 6), x2 = trim(x, 4), x3 = trim(x, right = 6))
einar
The text was updated successfully, but these errors were encountered:
@hadley: pmin(pmax(x, min_val), max_val) -- perhaps in vctrs?
Sorry, something went wrong.
Yeah, vctrs is the right place. Can you please move there?
No branches or pull requests
worth a thought?? in line with
between
. andstr_trim
. below also would return any NA'seinar
The text was updated successfully, but these errors were encountered: