ikey: Creates a unique integer key for unique combinations of rows...

Description Usage Arguments Value Examples

View source: R/ikey.R

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

1
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

1
2
3
4
5
6
7
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)

ffbase documentation built on Feb. 27, 2021, 5:06 p.m.