On Fri, 17 Jun 2005, Mike R wrote:

> k = c(1:9)
> if( length( which(k==3) ) ){ print("contained") }else{ print("not contained") 
> }
>
> is therre a simple way to test if a vector/list contains a particular value?

  value %in% vector

> more generally, is the a documentaion page that lists/describes all
> such operators?

No.  You can find binary operators fairly effectively by looking at the 
html help, because they have to have non-alphabetic names (either single 
characters or beginning and ending with %).

However, there are functions such as setdiff() that you might think of as 
binary operators that you wouldn't find this way.

        -thomas

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to