List all objects in a directory, along with their types.

listObjects(dir, include.children = FALSE)

Arguments

dir

String containing a path to a staging directory.

include.children

Logical scalar indicating whether to include child objects.

Value

DataFrame where each row corresponds to an object and contains;

  • path, the relative path to the object's subdirectory inside dir.

  • type, the type of the object

  • child, whether or not the object is a child of another object.

If include.children=FALSE, metadata is only returned for non-child objects.

Author

Aaron Lun

Examples

tmp <- tempfile()
dir.create(tmp)

library(S4Vectors)
df <- DataFrame(A=1:10, B=LETTERS[1:10])
saveObject(df, file.path(tmp, "whee"))

ll <- list(A=1, B=LETTERS, C=DataFrame(X=1:5))
saveObject(ll, file.path(tmp, "stuff"))

listObjects(tmp)
#> DataFrame with 2 rows and 3 columns
#>          path        type     child
#>   <character> <character> <logical>
#> 1       stuff simple_list     FALSE
#> 2        whee  data_frame     FALSE
listObjects(tmp, include.children=TRUE)
#> DataFrame with 3 rows and 3 columns
#>                     path        type     child
#>              <character> <character> <logical>
#> 1                  stuff simple_list     FALSE
#> 2 stuff/other_contents/0  data_frame      TRUE
#> 3                   whee  data_frame     FALSE