Read a list from its on-disk representation. This is usually not directly called by users, but is instead called by dispatch in readObject.

readBaseList(path, metadata, simple_list.parallel = TRUE, ...)

Arguments

path

String containing a path to a directory, itself created with the list method for stageObject.

metadata

Named list containing metadata for the object, see readObjectFile for details.

simple_list.parallel

Whether to perform reading and parsing in parallel for greater speed. Only relevant for lists stored in the JSON format.

...

Further arguments to be passed to altReadObject for complex child objects.

Value

The list represented by path.

Details

The uzuki2 specification (see https://github.com/ArtifactDB/uzuki2) allows length-1 vectors to be stored as-is or as a scalar. If the file stores a length-1 vector as-is, readBaseList will read the list element as a length-1 vector with the AsIs class. If the file stores a length-1 vector as a scalar, readBaseList will read the list element as a length-1 vector without this class. This allows downstream users to distinguish between the storage modes in the rare cases that it is necessary.

See also

"stageObject,list-method", for the staging method.

Author

Aaron Lun

Examples

library(S4Vectors)
ll <- list(A=1, B=LETTERS, C=DataFrame(X=letters))

tmp <- tempfile()
saveObject(ll, tmp)
readObject(tmp)
#> $A
#> [1] 1
#> 
#> $B
#>  [1] "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S"
#> [20] "T" "U" "V" "W" "X" "Y" "Z"
#> 
#> $C
#> DataFrame with 26 rows and 1 column
#>               X
#>     <character>
#> 1             a
#> 2             b
#> 3             c
#> 4             d
#> 5             e
#> ...         ...
#> 22            v
#> 23            w
#> 24            x
#> 25            y
#> 26            z
#>