DirectoryTable: Create an R variable table using a directory

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This creates a DirectoryTable object which is used to manage R variables by reading and writing them to disk in the directory associated with the table. The variables can be accessed in the usual manner i.e. by name without the need for an explicit get. This gives S-like storage by writing the objects to disk when they are assigned rather than at the end if the session.

Usage

1
DirectoryObjectTable(directory, create = TRUE)

Arguments

directory

a string giving the name of the directory in which the variables will be stored.

create

a logical value indicating whether the directory should be created if it does not exist.

Details

This creates an object of class DirectoryTable that stores the name of the directory. This is passed to the different db* methods (dbread, dbobjects, dbexists, dbwrite, ... as the first argument).

Value

An object of class DirectoryTable that also inherits from UserDefinedDatabase. This is a list containing a single element.

dir

the fully expanded name of the directory associated with table.

Author(s)

Duncan Temple Lang

References

http://developer.r-project.org/RObjectTables.pdf http://www.omegahat.org/RinS for storing R and S-Plus objects in a common format.

See Also

dbread, dbobjects, dbexists, dbwrite, newRFunctionTable, attach, detach

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  db <- DirectoryObjectTable("/tmp/myRData")
  dbwrite(db, "x", 1:10)
  dbwrite(db, "y", letters[1:3])
  dbobjects(db)
  dbread(db, "x")

  attach(newRFunctionTable(db), name = "myRData")

  assign("z", c(TRUE, FALSE), pos = "myRData")
  get("z", pos = 2)
  get("z")
  z

  detach("myRData")

jeroenooms/RObjectTables documentation built on May 19, 2019, 6:11 a.m.