Displaying 1 result from an estimated 1 matches for "keep_idx".
Did you mean:
eop_idx
2013 Aug 09
1
a fast table() for the 1D case
...uot; && any(is.na(x))) &&
!any(is.na(x2))
if (append_NA) {
x2 <- c(x2, NA)
x <- factor(x, levels=x2, exclude=NULL)
}
t2 <- tabulate(x, nbins=length(x2))
if (!is.null(exclude)) {
keep_idx <- which(!(x2 %in% exclude))
x2 <- x2[keep_idx]
t2 <- t2[keep_idx]
}
} else {
xx <- match(x, x)
t <- tabulate(xx, nbins=length(xx))
keep_idx <- which(t != 0L)
x2 <- x[keep_idx]
t2 <- t[keep_...