[R] Odp: better way to trick data frame structure?
petr.pikal at precheza.cz
Wed May 5 08:02:27 CEST 2010
r-help-bounces at r-project.org napsal dne 05.05.2010 07:49:25:
> I have a data frame where 1 variable is a factor with only 1 level. I
> the data frame structure to reflect that there are 2 levels for this
> even though this is not the case. I am currently adding extra 'fake'
> to the data frame to ensure that 2 levels are present, but this is
> processing time in a loop quite a bit. Can I manually specify that this
> factor variable has two levels (even though this is lying to R)?
Not at all lying. That is why hated factors are useful. Lust add all
Levels: M F
> View this message in context:
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help