Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

unique.ff

Unique values for ff and ffdf objects


Description

Unique values for ff and ffdf objects

Usage

## S3 method for class 'ff'
unique(x, incomparables = FALSE, fromLast = FALSE, trace = FALSE, ...)

## S3 method for class 'ffdf'
unique(x, incomparables = FALSE, fromLast = FALSE, trace = FALSE, ...)

Arguments

x

ff object or ffdf object

incomparables

a vector of values that cannot be compared. FALSE is a special value, meaning that all values can be compared, and may be the only value accepted for methods other than the default. It will be coerced internally to the same type as x.

fromLast

logical indicating if duplication should be considered from the last, i.e., the last (or rightmost) of identical elements will be kept

trace

logical indicating to show on which chunk the function is computing

...

other parameters passed on to chunk

Value

An ffdf with unique values in x or an ff vector with unique values in x if x is a ff vector.

See Also

Examples

data(iris)
irisdouble <- rbind(iris, iris)
ffiris <- as.ffdf(irisdouble)
## unique.ff
unique(ffiris$Sepal.Length)
unique(ffiris$Petal.Length)  
ffiris$Species[1] <- NA
unique(ffiris$Species)
levels(unique(ffiris$Species))
## unique.ffdf
uiris <- unique(ffiris, trace=TRUE, by=10)[,]
test <- unique(irisdouble)
dim(iris)
dim(irisdouble)
dim(uiris)
dim(test)

!apply(uiris, MARGIN=1, FUN=function(x) paste(x, collapse=",")) %in% 
  apply(test, MARGIN=1, FUN=function(x) paste(x, collapse=","))

!apply(test, MARGIN=1, FUN=function(x) paste(x, collapse=",")) %in% 
  apply(uiris, MARGIN=1, FUN=function(x) paste(x, collapse=","))

ffbase

Basic Statistical Functions for Package 'ff'

v0.13.3
GPL-3
Authors
Edwin de Jonge, Jan Wijffels, Jan van der Laan
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.