Search notes:

R: the %in% operator

Testing for occurence in a vector

%in% can be used to test wheather one or more elements of a vector occurs in another vector:
vec <- c('one', 'two', 'three', 'four', 'five')

'foo' %in% vec # FALSE
'two' %in% vec # TRUE

c('one', 'bar') %in% vec # TRUE FALSE
Github repository about-r, path: /operators/in/vector.R

See also

The match(…) function.
R operators

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758201147, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/R/operators/in/index(52): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78