UserDatabase: Create user-defined attach()able table

Description Usage Arguments Value Note See Also Examples

Description

These functions convert a user-level object into an R object that can be attached as an element of the R search path. The newRFunctionTable works on objects that have methods for the dbexists, dbread, ... functions.

newRClosureTable works on a collection of functions (usually sharing state with a common environment) that are called directly by the C-level interface between the R engine and the user-level table.

Usage

1
2

Arguments

db

a user-defined database object. When passed to newRClosureTable, this is a list of functions that implement the assign, get, exists, remove, objects, canCache, attach and detach. When passed to newRFunctionTable, this is an object with methods for the dbread, dbwrite, dbexists, dbremove, dbcanCache, dbattach, dbdetach functions.

Value

An object of class UserDefinedTable that is an external pointer to a C-level object that represents the R table. This object can then be used in a call to attach.

Note

This interface is experimental. Please ensure that important data is saved before using this.

See Also

attach http://developer.r-project.org/RTableObjects.pdf

Examples

1
2
3
4
5
6
7
  source(system.file("examples", "ListTable.S", package ="RObjectTables"))
  attach(newRClosureTable(createListHandlers(x=1:3, y = letters[1:4])), name ="my list table")
  assign("x", 1, pos = "my list table")
  objects(pos = 2)
  exists("x", pos = 2)
  remove("x", 1, pos = "my list table")
  exists("x", pos = 2)

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