Big Data Factors

DESCRIPTION:

Create or test for big data objects representing factors.

This function requires the bigdata library section to be loaded.

USAGE:

bdFactor(x, levels = <<see below>>, labels = <<see below>>,
         exclude = NA)
as.bdFactor(x)
is.bdFactor(x)

REQUIRED ARGUMENTS:

x
data, to be thought of as taking values on a finite set (the levels). Missing values ( NAs) are allowed.

For is.bdFactor, x may be any S-PLUS object.

For as.bdFactor, x may be a single-column bdFrame, a bdVector, or a vector.

OPTIONAL ARGUMENTS:

levels
optional vector of levels for the factor. Any data value that does not match a value in levels will be NA in the factor. The default value of levels is the sorted list of distinct values of x. (If x is numeric and contains NAs, they will be placed at the end of the default value for levels.) If x is character data or you want to exclude other values from the levels you can use the exclude argument.
labels
optional vector of values to use as labels for the levels of the factor. The default is as.character(levels).
exclude
a vector or of values to be excluded from forming levels. Any value that appears in both x and exclude will be NA in the result and it will not appear in the default levels attribute.

VALUE:

bdFactor and as.bdFactor return an object of class bdFactor, the big data analog of factor objects.

is.bdFactor returns TRUE if x inherits from bdFactor, and FALSE otherwise.

SEE ALSO:

, , , .

EXAMPLES:

bd.fuel <- as.bdFrame(fuel.frame)
is.bdFactor(bd.fuel$Type)

occupation <- c("doctor", "lawyer", "mechanic", "engineer")
bdFactor(occupation)