At the current state of master (commit 5717fd49ff69c844b01861ee113cff42fc60e2b6), the last line fails with the error
Error in `[.augvec`(ob, !is.na(ob)) : is_wholenumber(n_discr) is not TRUE
With this PR, the last line does not fail anymore.
It is only a quick fix because as a longer-term objective, it would probably be better to replace the role of attribute nobs_orig by an attribute that refers to the number of (possibly latent) response categories. The reason is that subsetting the rows of an augmented-rows matrix (or the elements of an augmented-length vector) is only legal in terms of the observations (individuals), not in terms of the (possibly latent) response categories. So the number of (possibly latent) response categories should always stay the same, in contrast to the number of observations. str() (and possibly other functions) may not adhere to the subsetting convention we are requiring, but even in those cases, it should be ok to assume the number of (possibly latent) response categories not to change (for str(), this is indeed correct). I'm sorry that the nobs_orig thing seems to have been a bad design choice from my side in PR #322.
This is a quick fix for a bug introduced by PR #433. Illustration of the bug (the RDS file is available here):
At the current state of
master
(commit 5717fd49ff69c844b01861ee113cff42fc60e2b6), the last line fails with the errorWith this PR, the last line does not fail anymore.
It is only a quick fix because as a longer-term objective, it would probably be better to replace the role of attribute
nobs_orig
by an attribute that refers to the number of (possibly latent) response categories. The reason is that subsetting the rows of an augmented-rows matrix (or the elements of an augmented-length vector) is only legal in terms of the observations (individuals), not in terms of the (possibly latent) response categories. So the number of (possibly latent) response categories should always stay the same, in contrast to the number of observations.str()
(and possibly other functions) may not adhere to the subsetting convention we are requiring, but even in those cases, it should be ok to assume the number of (possibly latent) response categories not to change (forstr()
, this is indeed correct). I'm sorry that thenobs_orig
thing seems to have been a bad design choice from my side in PR #322.