Fix bug in droplevels when an NA is present
Fix bug in %in% when lfactor has an NA value
Fix creating of an lfactor with labels.
A test "create with labels" used all.equal instead of expect_equal and so wan't running.
Now allows data input to the lfactor command to be taken from labels and levels.
Now passes tests in interactive R as well as when run from within devtools::test
as.integer and as.numeric now return potentially different values for all functions (not just when called in sparse.model.matrix). Essentially, the results of as.integer always start with 1 and go up by one while the results of as.numeric are the values that were used when creating the lfactor.
Fix bug in sparse.model.matrix. the basic issue is that, unlike model.matrix, sparse.model.matrix assumes that the result of as.integer() for a factor is ordered and starts at 1. This is worked around by sensing the function that calls as.integer and returning what sparse.model.matrix expects if the caller is fac2sparse, the specific function that makes this assumption
add test for sparse.model.matrix that runs when the Matrix package is in the stack at the time of testing
a function as.factor.lfactor is added but it only works when explicitly called
>= and <= now work with numeric or text inputs
fixed a bug so that as.numeric now returns the initial numeric levels
calls to setGeneric moved to be exclusively in all.R
setMethods moved to the file where the function is defined
all tests can now be run on CRAN
Fixed a bug in 'droplevels' that would set some levels to NA. This was making lfactors not work well with lm when some levels were unoccupied.
GTE operator works with numeric comparison but still does not work with text comparison.
Added 'droplevels' function that allows 'droplevels' to work on an lfactor.
Added 'relevel' function that returns an lfactor.
lfactors can be updated to either a level or an llevel. e.g. month[4] <- 6 has the same effect as month[4] <- "June".
in the [ function the drop argument now works as it does in factor.
in the [ function, not using an 'i' argument now works correctly.