On Tue, 30 Jun 2015, Steve Taylor wrote:

Using return() within a for loop makes no sense: only the first one will be 
returned.

Steve,

  Mea culpa. Didn't catch that.

How about:
alldf.B = subset(alldf, stream=='B')  # etc...

  I used to do each stream manually, like the above, and want to learn how
to loop through all of them ...

Also, have a look at unique(alldf$stream) or levels(alldf$stream) if you
want to use a for loop on each unique value.

  ... which unique() and levels() will probably do. Will test these tomorrow
after rading the man pages.

Many thanks,

Rich

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to