Re: [R] Simple loop

From: Jeff Newmiller <jdnewmil_at_dcn.davis.ca.us>
Date: Sat, 07 May 2011 09:56:57 -0700

"Cannot revert it"? Doesn't setting up a new default parameter in the calling function ("ave") accomplish that?



Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil_at_dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k

Sent from my phone. Please excuse my brevity.

peter dalgaard <pdalgd_at_gmail.com> wrote:

On May 7, 2011, at 17:21 , Hadley Wickham wrote: >> >> Well, ave() uses interaction(...) and interaction() has a "drop" argument, so >> >>> with(x, ave(H, Site, Prof, drop=TRUE, FUN=function(y)y-min(y))) >> [1] 8 0 51 0 33 22 21 0 > > I don't understand why this isn't the default. > > Hadley Defensive programming, maybe? It's not the default for interaction(), which makes sense, and if you pass a non-default option, you cannot revert it. Not that I can think up a case where you'd actually want to process the empty levels either. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes_at_cbs.dk Priv: PDalgd_at_gmail.com_____________________________________________
R-help@r-project.org mailing list 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.

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
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. Received on Sat 07 May 2011 - 16:59:02 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 07 May 2011 - 17:00:05 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive