Learn R Programming

PivotalR (version 0.1.18.5)

unique-methods: The Unique of an object

Description

This function gives the unique values of a db.obj, which are the column unique of a db.table or db.view.

Usage

# S4 method for db.obj
unique(x, incomparables = FALSE, ...)

Arguments

x

A db.obj object, which the column unique are to be computed. The object has to have only one column otherwise an error will be raised.

incomparables

Not implemented.

Not implemented.

Value

An '>db.Rquery, whose column is the unique value of the column.

See Also

'>db.obj, '>db.data.frame, '>db.table, '>db.view, '>db.Rquery are the class hierarchy structure of this package.

Examples

Run this code
# 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)
lk(x, 10)

## get unique of all columns
unique(x$sex)

db.disconnect(cid, verbose = FALSE)
# }

Run the code above in your browser using DataLab