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

1
2
## S4 method for signature '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.

Note

This function applies only onto db.obj with one column. If you want to put the unique values from multiple columns together, you have to use db.array

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 are the class hierarchy structure of this package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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)

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

db.disconnect(cid, verbose = FALSE)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.