From r-help Thu Nov 20 12:26:23 2003 From: "Pascal A. Niklaus" Date: Thu, 20 Nov 2003 12:26:23 +0000 To: r-help Subject: [R] Find value in vector (or matrix) X-MARC-Message: https://marc.info/?l=r-help&m=107151315421715 Hi all, Is there a function to check if a particular value is contained in a vector? I've looked at grep in the hope that I could use a Perl-like syntax, but obviously it's different... I'd like to do something like: y <- c("a","b","c") if("a" in y) { # "a" is not in y } Also, is there a way to generate character sequences similar to numeric sequences, e.g. something like "A":"J" ? I remember having seen a command doing this somewhere, but can't find it anymore Thanks Pascal