comm.fread: comm.fread

Description Usage Arguments Value Examples

View source: R/comm.fread.r

Description

Given a directory, comm.fread() reads all csv files contained in it in parallel with available resources.

Usage

1
2
comm.fread(dir, pattern = "*.csv", readers = comm.size(),
  rebalance = TRUE, verbose = 0, checksum = TRUE)

Arguments

dir

A directory containing the files desired to be read. The directory should be accessible to all readers.

pattern

The pattern for files desired to be read.

readers

The number of readers.

rebalance

Logical; should all ranks "balance" the return, meaning each has roughly the same number of rows?

verbose

Determines the verbosity level. Acceptable values are 0, 1, and 2 for least to most verbosity.

checksum

Logical; should numerical variable sums be reported to check input before and after rebalance?

Value

TODO

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
### Save code in a file "demo.r" and run with 2 processors by
### SHELL> mpiexec -np 2 Rscript demo.r
library(pbdMPI)
library(pbdIO)

path <- "/tmp/read"
comm.print(dir(path))
## [1] "a.csv" "b.csv"

X <- comm.fread(path)

comm.print(X, all.rank=TRUE)
## COMM.RANK = 0
##    a b c
## 1: 1 2 3
## COMM.RANK = 1
##    a b c
## 1: 2 3 4

finalize()

## End(Not run)

go-ski/pbdIO documentation built on July 5, 2017, 9:22 a.m.