Skip to content

How to make combination data

2 messages · Liaw, Andy, Jan Sabee

#
Is something like this what you're looking for?

fixSome <- function(..., fixed) {
    fList <- list(...)
    for (i in fixed) fList[[i]] <- fList[[i]][1]
    do.call("expand.grid", fList)
}
Var1 Var2   Var3   Var4
1 young   no    low female
2   mid   no    low female
3   old   no    low female
4 young   no   high female
5   mid   no   high female
6   old   no   high female
7 young   no medium female
8   mid   no medium female
9   old   no medium female

Andy
#
Thanks you very much.
Yes, this is exactly what I want.

Best wishes,
Jan Sabee
On 4/19/05, Liaw, Andy <andy_liaw at merck.com> wrote: