unique-methods {PivotalR} | R Documentation

## 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 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

    ## 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)

[Package PivotalR version 0.1.18.3.1 Index]