Skip to contents

Keep only atomic columns

Usage

keepOnlyAtomicCols(object, ...)

# S4 method for DFrame
keepOnlyAtomicCols(object)

# S4 method for data.frame
keepOnlyAtomicCols(object)

Arguments

object

Object.

...

Additional arguments.

Value

Modified object, containing only atomic columns.

Note

Updated 2023-09-08.

Examples

## DFrame ====
object <- S4Vectors::DataFrame(
    "a" = I(list(
        c(1L, 2L),
        c(3L, 4L),
        c(5L, 6L)
    )),
    "b" = c(TRUE, TRUE, FALSE),
    "c" = c("a", "b", "c"),
    row.names = c("x", "y", "z")
)
print(object)
#> DataFrame with 3 rows and 3 columns
#>        a         b           c
#>   <list> <logical> <character>
#> x    1,2      TRUE           a
#> y    3,4      TRUE           b
#> z    5,6     FALSE           c
object <- keepOnlyAtomicCols(object)
print(object)
#> DataFrame with 3 rows and 2 columns
#>           b           c
#>   <logical> <character>
#> x      TRUE           a
#> y      TRUE           b
#> z     FALSE           c