Search notes:

R function: subset

d <- data.frame ( 
   COL_1  = c('foo', 'bar', 'baz'),
   COL_2  = c(   1 ,    2 ,    3 ),
   COL_3  = c(  42 ,   99 ,  100 )
)

d
#   COL_1 COL_2 COL_3
# 1   foo     1    42
# 2   bar     2    99
# 3   baz     3   100

cat ("\n\n")

subset(d, COL_1 == 'bar' |  COL_3 ==100 )
#   COL_1 COL_2 COL_3
# 2   bar     2    99
# 3   baz     3   100
Github repository about-r, path: /functions/subset.R

See also

Index to (some) R functions

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...', 1758200861, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/R/functions/subset(56): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78