unnest2 | R Documentation |
Unnest a single list-column into expanded rows
unnest2(object, ...)
## S4 method for signature 'DFrame'
unnest2(object, col)
object |
Object. |
col |
|
... |
Additional arguments. |
Modified object, with a single unnested list-column expanded into rows.
Updated 2023-08-25.
tidyr::unnest()
.
## DFrame ====
suppressPackageStartupMessages({
library(IRanges)
library(pipette)
})
object <- as.DataFrame(list(
"col1" = CharacterList(
c("a", "b", "c", "d"),
c("e", "f", "g"),
c("h", "i")
),
"col2" = IntegerList(
seq(from = 1L, to = 2L),
seq(from = 3L, to = 4L),
seq(from = 5L, to = 6L)
),
"col3" = c("a", "b", "c")
))
print(object)
x <- unnest2(object, col = "col1")
print(x)
y <- unnest2(object, col = "col2")
print(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.