I suppose here's one way:
hasChar <- function(x, y) { length(grep(x, y)) > 0 }
hasChar("a", "abcd")
[1] TRUE
hasChar("e", "abcd")
[1] FALSE Andy
From: Terry Mu like: "a" %in% "abcd" TRUE Thanks.
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html