Learn R Programming

rsat (version 0.1.21)

unique,records,ANY-method: Extract unique elements

Description

It returns a records like x but with duplicate elements/rows removed.

Usage

# S4 method for records,ANY
unique(x)

Value

unique elements in records class

Arguments

x

a records object.

Examples

Run this code
if (FALSE) {
# load example rtoi
file.copy(from=system.file("ex/Navarre",package="rsat"),
         to=tempdir(),
         recursive = TRUE)

navarre <- read_rtoi(file.path(tempdir(),"Navarre"))

# get the records
rcds <- records(navarre)

duplicate.records <- c(rcds[1],rcds[1])
length(duplicate.records)
print(duplicate.records)
single.record <- unique(duplicate.records)
length(single.record)
print(single.record)
}

Run the code above in your browser using DataLab