Search notes:

R function: combn

elems <- c('A', 'B', 'C', 'D', 'E')

combn(elems, 1)
#      [,1] [,2] [,3] [,4] [,5]
# [1,] "A"  "B"  "C"  "D"  "E"

combn(elems, 2)
#      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
# [1,] "A"  "A"  "A"  "A"  "B"  "B"  "B"  "C"  "C"  "D"
# [2,] "B"  "C"  "D"  "E"  "C"  "D"  "E"  "D"  "E"  "E"


combn(elems, 3)
#      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
# [1,] "A"  "A"  "A"  "A"  "A"  "A"  "B"  "B"  "B"  "C"
# [2,] "B"  "B"  "B"  "C"  "C"  "D"  "C"  "C"  "D"  "D"
# [3,] "C"  "D"  "E"  "D"  "E"  "E"  "D"  "E"  "E"  "E"
Github repository about-r, path: /functions/combn.R

See also

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