unique-methods: The Unique of an object

Description Usage Arguments Value Note Author(s) See Also Examples

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)

PivotalR documentation built on March 13, 2021, 1:06 a.m.