I would like to remove the pixels that form a tiny and large cluster. From the answer given here: how to remove cluster of pixels using clump function in R, I can remove the