Learn R Programming

disk.frame (version 0.1.0)

collect.disk.frame: Bring the disk.frame into R as data.table/data.frame or as a list

Description

Bring the disk.frame into R as data.table/data.frame or as a list

Usage

# S3 method for disk.frame
collect(x, ..., parallel = !is.null(attr(x,
  "lazyfn")))

collect_list(x, simplify = FALSE, parallel = !is.null(attr(x, "lazyfn")))

Arguments

x

a disk.frame

...

not used

parallel

if TRUE the collection is performed in parallel. By default if there are delayed/lazy steps then it will be parallel, otherwise it will not be in parallel. This is because parallel requires transferring data from background R session to the current R session and if there is no computation then it's better to avoid transferring data between session, hence parallel = FALSE is a better choice

simplify

Should the result be simplified to array

Value

data.frame/data.table

list

Examples

Run this code
# NOT RUN {
cars.df = as.disk.frame(cars)
# use collect to bring the data into RAM as a data.table/data.frame
collect(cars.df)

# clean up
delete(cars.df)
cars.df = as.disk.frame(cars)

# returns the result as a list
collect_list(map(cars.df, ~1))

# clean up
delete(cars.df)
# }

Run the code above in your browser using DataLab