subset-struct-list | R Documentation |
These functions allow generic list behaviour.
## S3 method for class 'struct_list'
c(...)
## S3 method for class 'struct_list'
rep(x, ...)
## S3 method for class 'struct_list'
x$y
## S3 method for class 'struct_list'
x[...]
## S3 replacement method for class 'struct_list'
x[...] <- value
## S3 method for class 'struct_list'
x[[...]]
## S3 replacement method for class 'struct_list'
x[[...]] <- value
... |
generic support |
x |
a 'struct_list' |
y |
item to retrieve |
value |
the value |
a 'struct_list' with all the items
c(struct_list)
: Repeat a 'struct_list'
rep(struct_list)
: Repeat a 'struct_list'
$
: Subset a 'struct_list'
[
: Subset a 'struct_list'
`[`(struct_list) <- value
: Assign a subset to a 'struct_list'
[[
: get a value from a 'struct_list'
`[[`(struct_list) <- value
: set a single value in a 'struct_list'
x = struct(a=1,b=2,c=1:3,.class="test")
y = struct(a=4,b=5,c=1:3,.class="test")
z= tibble::tibble(a= 1:10, b=rep(c(x,y),5))
z$b
c(x,y)
c(rep(x,5),y)
class(c(rep(x,5),rep(y,5))[[1]])
as.struct_list(list(x,y))
#' x = struct(a=1,b=2,c=1:3,.class="test")
class(rep(c(x,y),5)[[1]]) == "test"
class(rep(x,5))
a = (rep(c(x,y),5))
a[[1]] = y
a
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.