eql-methods {PivotalR} | R Documentation

## Test if two objects point to the same table

### Description

This function checks if two `db.obj` objects are the equivalent. For objects of class `db.data.frame`, they need to have the same associated table. For objects of other types, they need to have identical expressions and the same associated table.

### Usage

    ## S4 method for signature 'db.obj,db.obj'
    eql(e1,e2)

### Arguments

`e1, e2` | The signature of the method. Both arguments are `db.obj` objects to be checked for equality.

### Details

Objects of type `db.data.frame` are considered equal if they have the same `content` representation, and their associated tables have the same name, connected datbase, and type. Objects of other types derived from `db.obj` are considered equal if they have the same values for `content` representation, `@.source`, `@.parent`, `@.expression`, `@.where`, `@.conn.id`, `@.col.data_type`, `@.is.factor` and `@.col.name`. Two objects of different types are always considered not equal.

### Value

A logical. Returns `TRUE` is the objects are equal.

### Author(s)

Author: Predictive Analytics Team at Pivotal Inc.

Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io

### See Also

`lk` or `lookat` Displays the actual data in a `db.obj` object.

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

    delete("abalone", conn.id = cid)
    as.db.data.frame(abalone, "abalone", conn.id = cid, verbose = FALSE)

    x <- db.data.frame('abalone', conn.id = cid, key = 'id') # use default connection 1

    y <- db.data.frame('abalone', conn.id = cid)

    ## Check for equality
    eql(x,y) # This returns true

    ## create a db.Rquery object
    z <- x[,] # x is a db.data.frame object, but z is not

    eql(x,z) # This returns false

    db.disconnect(cid, verbose = FALSE)

    ## End(Not run)

[Package PivotalR version 0.1.18.3.1 Index]