content: Print the content of a 'db.obj' object

Description Usage Arguments Value Author(s) See Also Examples

Description

A db.data.frame object's content is the table/view name that it points to. A db.Rquery object's content is the SQL query that represents the operations applied on an existing db.data.frame. This function is mainly for debugging. Normal user who is not familiar with SQL does not need to use it.

Usage

1

Arguments

x

A db.obj object, whose content will be returned.

Value

A string, the content of db.obj object x. A db.data.frame object's content is the table/view name that it points to. A db.Rquery object's content is the SQL query that represents the operations applied on an existing db.data.frame.

Author(s)

Author: Predictive Analytics Team at Pivotal Inc.

Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io

See Also

db.obj, db.data.frame, db.table, db.view, db.Rquery explain the definitions of the class hierarchy of this package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## Not run: 


## set up the database connection
## Assume that .port is port number and .dbname is the database name
cid <- db.connect(port = .port, dbname = .dbname, verbose = FALSE)

delete("abalone", conn.id = cid)
y <- as.db.data.frame(abalone, "abalone", conn.id = cid) # create a table
x <- db.data.frame("abalone", conn.id = cid, key = "id")

## actually, x and y are pointing the same table
eql(x, y) # returns TRUE

content(x)
content(x$id)
content(x$id < 10)
content(x[,1:5])
content(x == y) # this is different from eql(x, y)
content(sort(x, INDICES = x$id))
content(x[x$id<10,])
content(x[1:10,])
content(colSums(x))
content(by(x, NULL, sum))
content(by(x, x$sex, sum))

db.disconnect(cid, verbose = FALSE)

## End(Not run)

PivotalR documentation built on March 13, 2021, 1:06 a.m.