Berfungsi untuk membuat, memaksa, dan memeriksa kedua jenis daftar R.
list(…)
pairlist(…)<p></p><p>as.list(x, …)
# S3 method for environment
as.list(x, all.names = FALSE, sorted = FALSE, …)
as.pairlist(x)</p><p>is.list(x)
is.pairlist(x)</p><p>alist(…)</p>
| Parameter | Deskripsi |
|---|---|
… |
objects, possibly named. |
x |
object to be coerced or tested. |
all.names |
a logical indicating whether to copy all values or (default) only those whose names do not begin with a dot. |
sorted |
a logical indicating whether the names of the resulting list should be sorted (increasingly). Note that this is somewhat costly, but may be useful for comparison of environments. |
# NOT RUN {
require(graphics)
# create a plotting structure
pts <- list(x = cars[,1], y = cars[,2])
plot(pts)
is.pairlist(.Options) # a user-level pairlist
## "pre-allocate" an empty list of length 5
vector("list", 5)
# Argument lists
f <- function() x
# Note the specification of a "..." argument:
formals(f) <- al <- alist(x = , y = 2+3,
# }
# NOT RUN {
…
# }
# NOT RUN {
= )
f
al
## environment->list coercion
e1 <- new.env()
e1$a <- 10
e1$b <- 20
as.list(e1)
# }