
Last chance! 50% off unlimited learning
Sale ends in
Searches for matches to argument `pattern` within each element of a string column.
h2o.grep(
pattern,
x,
ignore.case = FALSE,
invert = FALSE,
output.logical = FALSE
)
H2OFrame holding the matching positions or a logical vector if `output.logical` is enabled.
A character string containing a regular expression.
An H2O frame that wraps a single string column.
If TRUE case is ignored during matching.
Identify elements that do not match the pattern.
If TRUE returns logical vector of indicators instead of list of matching positions
This function has similar semantics as R's native grep function and it supports a subset of its parameters. Default behavior is to return indices of the elements matching the pattern. Parameter `output.logical` can be used to return a logical vector indicating if the element matches the pattern (1) or not (0).
if (FALSE) {
library(h2o)
h2o.init()
addresses <- as.h2o(c("2307", "Leghorn St", "Mountain View", "CA", "94043"))
zip_codes <- addresses[h2o.grep("[0-9]{5}", addresses, output.logical = TRUE),]
}
Run the code above in your browser using DataLab