search for: vectorreturningfunction

Displaying 2 results from an estimated 2 matches for "vectorreturningfunction".

1999 Jan 17
1
Other core dumps, with apologies
...> looking at ways to teach R, it seemed that tapply would > accept a list of factors if the function being applied > returned a scalar, or a single factor if the function being > applied returned a vector, but it core dumped if it was used > as > > tapply(x,listOfFactors,vectorReturningFunction) > > My naive solution was : > > j <- tapply(x, listOfFactors) # get the product factor > answer <- tapply(x,j,vectorReturningFunction) > .... CODE TO GET THE LABELS RIGHT .... > ansmat <- array(unlist(answer), dim=someStuff, > dimnames=otherStuff)) > >...
1999 Jan 17
1
Other core dumps, with apologies
...> looking at ways to teach R, it seemed that tapply would > accept a list of factors if the function being applied > returned a scalar, or a single factor if the function being > applied returned a vector, but it core dumped if it was used > as > > tapply(x,listOfFactors,vectorReturningFunction) > > My naive solution was : > > j <- tapply(x, listOfFactors) # get the product factor > answer <- tapply(x,j,vectorReturningFunction) > .... CODE TO GET THE LABELS RIGHT .... > ansmat <- array(unlist(answer), dim=someStuff, > dimnames=otherStuff)) > >...