###--- >>> `factor' <<<----- Factors

	## alias	 help(factor)
	## alias	 help(ordered)
	## alias	 help(is.factor)
	## alias	 help(is.ordered)
	## alias	 help(as.factor)
	## alias	 help(as.ordered)
	## alias	 help(is.na<-.factor)

##___ Examples ___:

ff <- factor(substring("statistics", 1:10, 1:10), levels=letters)
ff
codes(ff)
factor(ff)# drops the levels that do not occur
factor(factor(letters[7:10])[2:3]) # exercise indexing and reduction
factor(letters[1:20], label="letter")

class(ordered(4:1))# "ordered", inheriting from "factor"

## suppose you want "NA" as a level, and to allowing missing values.
(x <- factor(c(1, 2, "NA"), exclude = ""))
is.na(x)[2] <- T
x  # [1] 1    <NA> NA, <NA> used because NA is a level.
is.na(x)
# [1] FALSE  TRUE FALSE

## Keywords: 'category', 'NA'.


