Skip to contents

Returns one row per element of the distribution: each FileObject, a single file, and each FileSet, the files that match its glob patterns.

Usage

files(x, output = c("data.table", "tibble", "data.frame", "arrow"), ...)

Arguments

x

Croissant object.

output

Character {"data.table", "tibble", "data.frame", "arrow"}: Class of the result. "tibble" requires the 'tibble' package and "arrow" the 'arrow' package.

...

Not used.

Value

A data.table, tibble, data.frame, or arrow Table, by output, with character columns id, type ("FileObject" or "FileSet"), content_url, includes (the glob patterns of a file set), encoding_format, content_size (as the document writes it, such as "117743 B"), sha256, md5, and contained_in (@id of each enclosing file object or file set). A property the node does not set is NA; several values are separated by ", ".

Author

EDG

Examples

file <- tempfile(fileext = ".csv")
x <- croissant_from_data(
  data.frame(age = c(22L, 38L), sex = factor(c("male", "female"))),
  file = file,
  name = "people"
)
files(x)
#>                      id       type          content_url includes
#>                  <char>     <char>               <char>   <char>
#> 1: filec2e27bf31499.csv FileObject filec2e27bf31499.csv     <NA>
#>    encoding_format content_size
#>             <char>       <char>
#> 1:        text/csv         26 B
#>                                                              sha256    md5
#>                                                              <char> <char>
#> 1: ba1ff01837f947f95561d02390020012e5ab90dcd006cfe0279bfbeac724b542   <NA>
#>    contained_in
#>          <char>
#> 1:         <NA>
unlink(file)