Displaying 1 result from an estimated 1 matches for "grpi".
Did you mean:
grp
2002 Jun 11
2
Puzzled by what Rprof is telling me
...uld be, and would appreciate any suggestions.
Thanks
-Don
Details, unfortunately lengthy, are here:
The snippet of code I'm profiling is given below. 'inmat' is a
numeric matrix with 128347 rows; I need to apply a function, sfun(),
to each of 4191 subsets of rows, indexed by indat$grpi. sfun() is
fairly complex, and requires information from all of the columns of
inmat, so simple uses of, for example, aggregate() don't do the job.
Rprof('Rpf3n')
for (i in unique(indat$grpi)) {
ssnew[i,] <- sfun(inmat[indat$grpi==i,,drop=FALSE])
}
Rprof(NULL)
----------------...