Learn R Programming

ffbase (version 0.13.3)

ikey: Creates a unique integer key for unique combinations of rows of an ffdf

Description

Creates a unique integer key for unique combinations of rows of an ffdf. In database terms this would correspond to a primary or foreign key. Orders the ffdf decreasingly alongside the columns with NA's as last in the order and creates the integer key.

Usage

ikey(x, ...)

Arguments

x

an ffdf

...

other parameters passed on to chunk

Value

An integer ff vector of the same length as the number of rows in x with unique values for each unique row

Examples

Run this code
# NOT RUN {
oldffmaxbytes <- getOption("ffmaxbytes")
options(ffmaxbytes = 20)
ffiris <- as.ffdf(iris)
ffiris$key1 <- ikey(ffiris)
ffiris$key2 <- ikey(ffiris[c("Petal.Width","Species")])
unique(ffiris[c("key2","Petal.Width","Species")])[,]
options(ffmaxbytes = oldffmaxbytes)

# }

Run the code above in your browser using DataLab