Last chance! 50% off unlimited learning
Sale ends in
'>db.obj
objectsOperators acting on '>db.obj
objects to extract
or replace parts.
# S4 method for db.obj
$(x, name)
# S4 method for db.obj
[[(x, i, j, ...)
# S4 method for db.obj,ANY,ANY,ANY
[(x, i, j, ..., drop = TRUE)
# S4 method for db.obj,character
$(x, name) <- value
# S4 method for db.obj,integer
$(x, name) <- value
# S4 method for db.obj,numeric
$(x, name) <- value
# S4 method for db.obj,logical
$(x, name) <- value
# S4 method for db.obj,db.Rquery
$(x, name) <- value
# S4 method for db.obj,ANY,ANY,character
[[(x, i, j) <- value
# S4 method for db.obj,ANY,ANY,integer
[[(x, i, j) <- value
# S4 method for db.obj,ANY,ANY,numeric
[[(x, i, j) <- value
# S4 method for db.obj,ANY,ANY,logical
[[(x, i, j) <- value
# S4 method for db.obj,ANY,ANY,db.Rquery
[[(x, i, j) <- value
# S3 method for db.obj
[(x, i, j) <- value
A db.obj
(either db.table
, db.view
,
or db.Rquery
) from which to extract element(s).
A string. The column name.
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
.
subset,db.obj-method
Operator to extract elements
# NOT RUN {
<!-- %% @test .port Database port number -->
<!-- %% @test .dbname Database name -->
## 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)
# }
Run the code above in your browser using DataLab