Combine the rice, peas or beans, water, coconut, thyme, onion and salt and pepper in a large saucepan. Stir constantly while bringing to a boil -- you can stop stirring when the creamed coconut has melted. Simmer gently for 20 minutes.
Remove the lid and allow to finish cooking uncovered for 5 additional minutes to ensure any extra liquid is driven off. Remove from heat and occasionally toss to keep the grains separated.