[R] getting data frame rows out of a by object

Douglas Bates bates at stat.wisc.edu
Thu Apr 8 17:02:31 CEST 2004


Ed L Cashin <ecashin at uga.edu> writes:

> Douglas Bates <bates at stat.wisc.edu> writes:
> 
> ...
> > The point is that factor(paste(...)) returns a factor with length of
> > nrow(d) and with factor levels determined by the combination of levels
> > of a and b (provided that you don't get ambiguities as described
> > above).  The split function does not require that the factor
> > determining the splits be part of the data frame being split.  It can
> > be given explicitly as it is here.
> 
> I think I need to look at the source of split when I have more time.

?split is probably a better place to start.

> > [1] If you really want to be cautious you could use an octal
> > representation like sep="\007" to get a character that is very
> > unlikely to occur in a factor level.
> 
> I definitely want to be cautious.  Instead of the bell character I
> think I'll use the field separator character, "\034", just because
> this is the first time I've been able to use it for it's intended
> purpose!  ;)

Yes, but with "\034" you don't get to make obscure James Bond
references :-).




More information about the R-help mailing list