Stage a DataFrame by saving it to a HDF5 file.

# S4 method for class 'DataFrame'
saveObject(x, path, ...)

Arguments

x

A DataFrame.

path

String containing the path to a directory in which to save x.

...

Additional named arguments to pass to specific methods.

Value

A named list containing the metadata for x. x itself is written to a CSV or HDF5 file inside path. Additional files may also be created inside path and referenced from the metadata.

Details

This method creates a basic_columns.h5 file that contains columns for atomic vectors, factors, dates and date-times. Dates and date-times are converted to character vectors and saved as such inside the file. Factors are saved as a HDF5 group with both the codes and the levels as separate datasets.

Any non-atomic columns are saved to a other_columns subdirectory inside path via saveObject, named after its zero-based positional index within x.

If metadata or mcols are present, they are saved to the other_annotations and column_annotations subdirectories, respectively, via saveObject.

Author

Aaron Lun

Examples

library(S4Vectors)
df <- DataFrame(A=1:10, B=LETTERS[1:10])

tmp <- tempfile()
saveObject(df, tmp)
list.files(tmp, recursive=TRUE)
#> [1] "OBJECT"           "basic_columns.h5"