View | Details | Raw Unified | Return to bug 16640 | Differences between
and this patch

Collapse All | Expand All

(-)tapply.R (-3 / +3 lines)
Lines 33-42 Link Here
33
	index <- as.factor(INDEX[[i]])
33
	index <- as.factor(INDEX[[i]])
34
	if (length(index) != nx)
34
	if (length(index) != nx)
35
	    stop("arguments must have same length")
35
	    stop("arguments must have same length")
36
	namelist[[i]] <- levels(index)#- all of them, yes !
36
	namelist[[i]] <- levi <- levels(index)#- all of them, yes !
37
	extent[i] <- nlevels(index)
37
	extent[i] <- ei <- length(levi)
38
	group <- group + ngroup * (as.integer(index) - one)
38
	group <- group + ngroup * (as.integer(index) - one)
39
	ngroup <- ngroup * nlevels(index)
39
	ngroup <- ngroup * ei
40
    }
40
    }
41
    if (is.null(FUN)) return(group)
41
    if (is.null(FUN)) return(group)
42
    ans <- lapply(X = split(X, group), FUN = FUN, ...)
42
    ans <- lapply(X = split(X, group), FUN = FUN, ...)

Return to bug 16640