# NOT RUN {
# interval replacement operators
x <- 1:10
x %in[]% c(3,7) <- 0
x
x <- 1:10
x %in[)% c(3,7) <- NA
x
x <- 1:10
x %out[)% c(3,7) <- x
x
# regular expression replacement operators
region <- as.character(state.region)
table(region)
region %in~% "^North" <- "North"
table(region)
# count based replacement operators
carb <- mtcars$carb
table(carb, useNA="always")
carb %in#% 1 <- NA
table(carb, useNA="always")
# }
Run the code above in your browser using DataLab