Learn R Programming

datadr (version 0.8.6.1)

localDiskConn: Connect to Data Source on Local Disk

Description

Connect to a data source on local disk

Usage

localDiskConn(loc, nBins = 0, fileHashFn = NULL, autoYes = FALSE,
  reset = FALSE, verbose = TRUE)

Arguments

loc

location on local disk for the data source

nBins

number of bins (subdirectories) to put data files into - if anticipating a large number of k/v pairs, it is a good idea to set this to something bigger than 0

fileHashFn

an optional function that operates on each key-value pair to determine the subdirectory structure for where the data should be stored for that subset, or can be specified "asis" when keys are scalar strings

autoYes

automatically answer "yes" to questions about creating a path on local disk

reset

should existing metadata for this object be overwritten?

verbose

logical - print messages about what is being done

Value

a "kvConnection" object of class "localDiskConn"

Details

This simply creates a "connection" to a directory on local disk (which need not have data in it). To actually do things with this connection, see ddo, etc. Typically, you should just use loc to specify where the data is or where you would like data for this connection to be stored. Metadata for the object is also stored in this directory.

See Also

addData, ddo, ddf, localDiskConn

Examples

Run this code
# NOT RUN {
# connect to empty localDisk directory
conn <- localDiskConn(file.path(tempdir(), "irisSplit"), autoYes = TRUE)
# add some data
addData(conn, list(list("1", iris[1:10,])))
addData(conn, list(list("2", iris[11:110,])))
addData(conn, list(list("3", iris[111:150,])))
# represent it as a distributed data frame
irisDdf <- ddf(conn, update = TRUE)
irisDdf
# }

Run the code above in your browser using DataLab