(which.*): vector of cell numbers (if x is a RasterLayer). If x is a RasterStack or RasterBrick, a RasterLayer giving the number of the first layer with the minimum or maximum value for a cell.
(whiches.*). An integer in which each digit represents a layer. For example, 35 means "layers 3 and 5"
b <- brick(system.file("external/rlogo.grd", package="raster"))
r <- which.min(b)
i <- which.min(b[[3]])
xy <- xyFromCell(b, i)
plot(b[[3]])
points(xy)
x <- whiches.min(b)
freq(x)