From hpages at fredhutch.org  Mon May 18 22:31:53 2015
From: hpages at fredhutch.org (=?windows-1252?Q?Herv=E9_Pag=E8s?=)
Date: Mon, 18 May 2015 13:31:53 -0700
Subject: [Rd] \alias{} --> rather \concept{} for conceptual "links" to
 help pages
In-Reply-To: <21849.55180.666190.313680@stat.math.ethz.ch>
References: <CALcakBaPjYfqzjqE8a5VhRF5NG4tvbsyOcn-6TiTH-dUvNZT1A@mail.gmail.com>	<CACk-te1FO5rhrVrbkU8JF2ONOfBOAEGsB9JMAvShjG0cfBEGVQ@mail.gmail.com>	<CALcakBbQpNzSHJCixYfn=2nPzS2mSX4u4jayBOq6tJ6wLx4BXg@mail.gmail.com>	<CACk-te3y7CHniVYJLUnxNiK-Mg=3gXC8ZwG0NBd_Ganiawz2Ag@mail.gmail.com>	<CA+8X3fVXnyP4kJNV+D7fscap+ceL7WFw49=tFpC0-YcVDjAquw@mail.gmail.com>
	<21849.55180.666190.313680@stat.math.ethz.ch>
Message-ID: <555A4C39.6000807@fredhutch.org>

Hi Martin,

On 05/18/2015 05:14 AM, Martin Maechler wrote:
>  From R-help, subject  "Variable number of loops"
> I've opened a new thread, moving from R-help to R-devel ..
>
>>>>>> Jim Lemon <drjimlemon at gmail.com>
>>>>>>      on Sun, 17 May 2015 09:19:06 +1000 writes:
>
>      > Hi all, Given the number of help requests that involve
>      > permutations/combinations, and the less than obvious
>      > naming of the expand.grid function, perhaps adding an
>      > alias such as "permute.elements" or "combine.elements"
>      > might ease the tasks of both searchers and those offering
>      > help. Neither of the above names appear to be used at
>      > present.
>
>      > Jim
>
>
> Using \alias{} is not a very good thing here, since as you know they
> are *key*s that must remain unique if possible and they can be
> linked to -- which I think would not be helpful for  'expand.grid'.

It seems to me that Jim was maybe suggesting to define an alias for the
expand.grid function i.e. something like:

   permute.elements <- expand.grid

or

   combine.elements <- expand.grid

as a way to address the "less than obvious naming of the expand.grid
function". But maybe I misunderstood...

Cheers,
H.

>
> Rather, for quite a few years now, we have had \concept{} for
> adding "search keywords", i.e., things that
> help.search()  and hence ??<topic>  will find.
>
> The other advantage of \concept{} is that you can use short
> phrases, i.e.,
>
> \concept{all variable combinations}
>
> would be possible here.
>
> (Better wording proposals for this specific case are welcome! --
>   maybe privately).
>
> Martin Maechler, ETH Zurich
>
>
>      > On Sun, May 17, 2015 at 5:54 AM, Bert Gunter
>      > <gunter.berton at gene.com> wrote:
>      >> 1. Please always reply to the list unless there is a
>      >> compelling reason to keep the discussion private. You
>      >> will have a better chance of getting something useful
>      >> that way.
>      >>
>      >> 2. I don't know what you mean by "I don't have a fixed
>      >> number of variables." You have to specify at least the
>      >> number of variables and how many levels each has in order
>      >> to work out what you requested, which is **NOT** the
>      >> number of permutations but the number of combinations
>      >> AFAICS, which is exactly what expand.grid will give you.
>      >>
>      >> 3. Maybe what you're looking for is the ... arguments in
>      >> function calls, which would be used along the lines of:
>      >>
>      >> myfun <- function( x,y,...)  { ## some code combs <-
>      >> expand.grid(...)  ## some more code }
>      >>
>      >> Any good R tutorial will tell you about this if this is
>      >> unfamiliar.
>      >>
>      >> 4. Another possibility might be to deliver a list of
>      >> named variables as an argument and then use do.call, e.g.
>      >>
>      >> myfun <- (x,y, alist) { ## some code combs <-
>      >> do.call(expand.grid, alist) ## some more code }
>      >>
>      >> ?do.call and/or a tutorial for details.
>      >>
>      >> 5. Otherwise, maybe someone else can figure out what
>      >> you're looking for.
>      >>
>      >> Cheers, Bert
>      >>
>      >>
>      >>
>      >> Bert Gunter Genentech Nonclinical Biostatistics (650)
>      >> 467-7374
>      >>
>      >> "Data is not information. Information is not
>      >> knowledge. And knowledge is certainly not wisdom."
>      >> Clifford Stoll
>      >>
>      >>
>      >>
>      >>
>      >> On Sat, May 16, 2015 at 11:16 AM, WRAY NICHOLAS
>      >> <nicholas.wray at ntlworld.com> wrote:
>      >>> I might be but doesn't expand.grid need a defined and
>      >>> listed number of inputs?  The problem I'm having is that
>      >>> the number of variables is not fixed, so I'm not sure
>      >>> whether I can reference the variable number of variables
>      >>> by using a vector -- haven't had time to try yet But
>      >>> thanks anyway Nick Wray
>      >>>
>      >>> On 16 May 2015 at 14:28, Bert Gunter
>      >>> <gunter.berton at gene.com> wrote:
>      >>>>
>      >>>> Are you trying to reinvent ?expand.grid ?
>      >>>>
>      >>>> -- Bert
>      >>>>
>      >>>> Bert Gunter Genentech Nonclinical Biostatistics (650)
>      >>>> 467-7374
>      >>>>
>      >>>> "Data is not information. Information is not
>      >>>> knowledge. And knowledge is certainly not wisdom."
>      >>>> Clifford Stoll
>      >>>>
>   [...............]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Herv? Pag?s

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fredhutch.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



[Rd] \alias{} --> rather \concept{} for conceptual "links" to help pages
=?windows-1252?Q?Herv=E9_Pag=E8s?=