dropall: Dropall

Description Usage Arguments Details Value Author(s) Examples

View source: R/DropAll.r

Description

Drops unused factor levels in data.frames

Usage

1

Arguments

x

a data.frame

Details

This function makes sure that the factor levels in a data.frame do not contain entries that have already been removed from the factor itself.

See also: http://en.opasnet.org/

Value

data.frame

Author(s)

J. Tuomisto [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
a <- data.frame(A = c("a", "b"), B = c(1,1))
levels(a[[1]])

a <- a[-2 ,]
levels(a[[1]])
a[[1]]

a <- dropall(a)
levels(a[[1]])
a[[1]]

OpasnetUtils documentation built on July 4, 2017, 9:44 a.m.