Skip to contents

Ensure all columns in the object are atomic.

Usage

atomize(object, ...)

# S4 method for DFrame
atomize(object)

# S4 method for Ranges
atomize(object)

# S4 method for data.frame
atomize(object)

Arguments

object

Object.

...

Additional arguments.

Value

Modified object. Non-atomic columns (e.g. list or complex S4 classes) will be dropped.

Details

Keep only atomic columns. Complex columns won't write to disk as CSVs or work with R Markdown functions, in some cases.

Note

Updated 2022-05-25.

Examples

df <- S4Vectors::DataFrame(
    "a" = "a",
    "b" = I(list("a" = seq_len(3L)))
)
lapply(df, is.atomic)
#> $a
#> [1] TRUE
#> 
#> $b
#> [1] FALSE
#> 
x <- atomize(df)
#>  Dropping 1 non-atomic column: "b".