Dear R users,

The "lfactors" package is now available from CRAN. It provides a class 
"lfactor" that is similar to the class "factor" but can be referred to by level 
or label.

This package is best explained with an example

flips <- lfactor(c(0,1,1,0,0,1), levels=0:1, labels=c("Tails", "Heads"))
# Tails can now be referred to as, "Tails" or 0
# These two lines return the same result
flips == "Tails"
flips == 0

Other functions, such as %in% and != also work with lfactors.

This package is helpful for data that was labeled with long labels, making 
references to the label cumbersome. This happens to me when I'm sharing data 
with users of other statistical software that uses the same convention as 
lfactors--that is, allowing a factor level to be referred to by its numeric or 
character value.

Comments, contributions, and suggests are welcome.

Best,
Paul
---
Paul D. Bailey, Ph.D.
Economist, Education
American Institutes for Research
202.403.5694

_______________________________________________
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to