Search notes:

R function: unlist

unlist(…) can be used to turn a list into a vector.
l = list(
     a = c('1', '2', '3'),
     b = c('4', '5', '6'),
     m = matrix (
           c(100, 101, 102, 103,
             104, 105, 106, 107),
           ncol  = 2,
           byrow = TRUE
    )
)

options(width=300)
ul = unlist(l)
ul
#    a1    a2    a3    b1    b2    b3    m1    m2    m3    m4    m5    m6    m7    m8
#   "1"   "2"   "3"   "4"   "5"   "6" "100" "102" "104" "106" "101" "103" "105" "107"

typeof(ul)
# [1] "character"

sum(as.numeric(ul))
# [1] 849
Github repository about-r, path: /functions/unlist.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...', 1745468781, '18.221.176.186', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/R/functions/unlist(62): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78