Preheat the oven to 350°F (175°C). Line a muffin tin with paper liners or grease well.
In a large bowl, whisk together the flour, baking powder, baking soda, salt, cinnamon, and nutmeg.
In another bowl, mix the granulated sugar, brown sugar, eggs, oil, milk, and vanilla extract until well combined.
Pour the wet ingredients into the dry ingredients and stir until just combined. Fold in the grated carrots, nuts, and raisins or coconut.
Divide the batter evenly among the muffin cups, filling each about ⅔ full.
Bake for 18-20 minutes or until a toothpick inserted into the center comes out clean. Let cool in the pan for 5 minutes, then transfer to a wire rack.
For the topping, beat the cream cheese and butter until smooth. Add the powdered sugar and vanilla, mixing until creamy. Spread on cooled muffins if desired.
Notes
Store muffins in an airtight container at room temperature for up to 3 days or freeze for longer storage.