Learn R Programming

h2o (version 2.8.4.4)

h2o.gsub: Pattern Replacement

Description

h2o.gsub, a method for the h2o.gsub base method.

Usage

h2o.gsub(pattern, replacement, x, ignore.case)

Arguments

pattern
A regex or string to match on.
replacement
A string that replaces the matched pattern.
x
An H2OParsedData object with a single factor column.
ignore.case
If TRUE, case will be ignored in the pattern match

Value

  • An object of class "H2OParsedData".

Details

Matches a pattern and replaces all instances of the matched pattern with the replacement string.

Examples

Run this code
library(h2o)
localH2O <- h2o.init(ip = "localhost", port = 54321, startH2O = TRUE)
df <- data.frame(
    V1 = c("HELLO WoR@&^LD", "the dOg ATE", "my friENd BOb Ace", "mEow meOW"),
    V2 = c(92318, 34891.123, 21,99))
hex <- as.h2o(localH2O, df)
h2o.gsub("HELLO", "WHY HELLO THERE", hex$V1)

Run the code above in your browser using DataLab