Learn R Programming

yamlet (version 0.9.3)

classified.default: Create Classified by Default

Description

Creates a factor of subclass 'classified', for which there are attribute-preserving methods. In particular, classified has a codelist attribute indicating the origin of its levels: it is constructed from the codelist attribute of x if available, or from 'levels' and 'labels' by default. Unlike the case for factor, length of labels cannot be one (i.e., different from length of levels).

Usage

# S3 method for default
classified(
  x = character(),
  levels,
  labels = levels,
  exclude = NA,
  ordered = is.ordered(x),
  nmax = NA,
  ...
)

Value

'classified' 'factor'

Arguments

x

see factor

levels

see factor

labels

see factor, must have same length as levels

exclude

see factor

ordered

see factor

nmax

see factor

...

ignored

See Also

Other classified: [.classified(), [<-.classified(), [[.classified(), [[<-.classified(), as.integer.classified(), c.classified(), classified.classified(), classified.data.frame(), classified.dvec(), classified(), desolve.classified(), unclassified.classified(), unclassified.data.frame(), unclassified()

Examples

Run this code
classified(1:3)
classified(1:3, levels = 4:6)
classified(1:3, levels = 1:3)
classified(1:3, labels = letters[1:3])

Run the code above in your browser using DataLab