as.integer.lfactor: Integer Vectors from lfactors

Description Usage Arguments Details See Also Examples

Description

Returns integer representation of an lfactor that ignores the values used in the levels argument when the lfactor was created and instead returns an integer representation starting with 1.

Usage

1
2
## S3 method for class 'lfactor'
as.integer(x, ...)

Arguments

x

same as as.integer

...

not used

Details

This method does not return integer results that are otherwise equal to the results from as.numeric for compatability with sparse.model.matrix.

See Also

as.integer, as.numeric.lfactor

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
require(lfactors)
# create an example
let <- lfactor(4:12,
               levels=4:12,
               labels=letters[4:12])

as.numeric(let)
#same as as.numeric(4:12)
as.integer(let)
#same as 1:9


Search within the lfactors package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.