Extract-Replace-methods | R Documentation |
db.obj
objectsOperators acting on db.obj
objects to extract
or replace parts.
## S4 method for signature 'db.obj'
x$name
## S4 method for signature 'db.obj'
x[[i, j, ...]]
## S4 method for signature 'db.obj,ANY,ANY,ANY'
x[i, j, ..., drop = TRUE]
## S4 replacement method for signature 'db.obj,character'
x$name <- value
## S4 replacement method for signature 'db.obj,integer'
x$name <- value
## S4 replacement method for signature 'db.obj,numeric'
x$name <- value
## S4 replacement method for signature 'db.obj,logical'
x$name <- value
## S4 replacement method for signature 'db.obj,db.Rquery'
x$name <- value
## S4 replacement method for signature 'db.obj,ANY,ANY,character'
x[[i, j]] <- value
## S4 replacement method for signature 'db.obj,ANY,ANY,integer'
x[[i, j]] <- value
## S4 replacement method for signature 'db.obj,ANY,ANY,numeric'
x[[i, j]] <- value
## S4 replacement method for signature 'db.obj,ANY,ANY,logical'
x[[i, j]] <- value
## S4 replacement method for signature 'db.obj,ANY,ANY,db.Rquery'
x[[i, j]] <- value
## S3 replacement method for class 'db.obj'
x[i, j] <- value
x |
A |
i, j, ... |
Indices specifying elements to extract or replace. Indices
are ‘numeric’ or ‘character’ vectors or
|
name |
A string. The column name. |
value |
Any valid value, including |
drop |
Not implemented yet. |
A db.Rquery
object is returned. For the extraction methods,
this is a
SQL query to extract the requested subset. For the replacement
methods, this is a SQL query representing the modified version of
x
.
Author: Predictive Analytics Team at Pivotal Inc.
Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io
subset,db.obj-method
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)
x$area <- x[["length"]] * x[,"height"] # add a new column
y <- x[,-c(1,2)] # use all columns except the first two
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.