[R] Opinion: Why I find factors convenient to use

Peter Langfelder peter.langfelder at gmail.com
Fri Aug 17 20:42:57 CEST 2012


On Fri, Aug 17, 2012 at 11:34 AM, Rui Barradas <ruipbarradas at sapo.pt> wrote:
> Hello,
>
> No, factors may use less memory. System dependent?

I think it's a 32-bit vs. 64-bit distinction - I get Rui's results on
64-bit Windows and Linux installation, but Bert's result on a 32-bit
Linux machine.

Peter

>
>> x <-sample(c("small","medium","large"),1e4,rep=TRUE)
>> y <- factor(x)
>> object.size(x)
> 80184 bytes
>> object.size(y)
> 40576 bytes



More information about the R-help mailing list