Function to implement a two stage cluster sampling with R