Description Usage Arguments Value Author(s) See Also Examples
Copies elements of a list, either indexed or named
1 |
x |
|
index |
|
list
Thomas P. Harte
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # NULL list:
copy(list(), integer(0))
# unnamed list:
x<- list(1, 2, 3)
x
copy(x, integer(0))
copy(x, 1:2)
# named list:
x<- list(a=1, b=2, c=3)
x
# integer index still works:
copy(x, 1:2)
# named index works too:
copy(x, c("a","b"))
## FIXME: index mismatch
## copy(x, 1:4)
## copy(x, c("a","b"))
## copy(x, c("a","b","d"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.