subset-methods | R Documentation |
This function extracts a subset of a db.obj
which could either be
a db.table
or db.view
object.
## S4 method for signature 'db.obj'
subset(x, subset, select)
x |
A |
subset, select |
Indices specifying elements to extract or replace. Indices are ‘numeric’ or ‘character’ vectors or empty (missing) or ‘NULL’. Numeric values are coerced to integer as by ‘as.integer’ (and hence truncated towards zero). |
A db.Rquery
object is returned which is a SQL query to extract the
requested subset.
Author: Predictive Analytics Team at Pivotal Inc.
Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io
[-methods
Operator to extract elements
## 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)
x <- as.db.data.frame(abalone, conn.id = cid, verbose = FALSE)
lk(x, 10)
lk(x[1:3])
lk(subset(x, 1:3))
db.disconnect(cid, verbose = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.