Examples for 'base::list'


Lists - Generic and Dotted Pairs

Aliases: list pairlist alist as.list as.list.default as.list.data.frame as.list.environment as.list.factor as.list.function as.pairlist is.list is.pairlist

Keywords: list manip

### ** Examples

require(graphics)

# create a plotting structure
pts <- list(x = cars[,1], y = cars[,2])
plot(pts)
plot of chunk example-base-list-1
is.pairlist(.Options)  # a user-level pairlist
[1] TRUE
## "pre-allocate" an empty list of length 5
vector("list", 5)
[[1]]
NULL

[[2]]
NULL

[[3]]
NULL

[[4]]
NULL

[[5]]
NULL
# Argument lists
f <- function() x
# Note the specification of a "..." argument:
formals(f) <- al <- alist(x = , y = 2+3, ... = )
f
function (x, y = 2 + 3, ...) 
x
<environment: 0x55ccff4aed38>
al
$x


$y
2 + 3

$...
## environment->list coercion

e1 <- new.env()
e1$a <- 10
e1$b <- 20
as.list(e1)
$a
[1] 10

$b
[1] 20

[Package base version 4.2.3 Index]