Preheat oven to 350°F/175°C. Line a cupcake pan with 12 paper liners.
To make cupcakes: Wash and peel carrots. Grate the carrots using the fine grate side of a box grater. Set aside.
In a large bowl, whisk flour, baking powder, baking soda, salt, cinnamon and nutmeg together. Set aside.
In a medium bowl, whisk together oil, brown sugar, granulated sugar, eggs, yogurt and vanilla extract until smooth and fluffy. Add the dry mixture into the wet mixture and mix just until combined. Don’t overmix. Fold in the carrots, nuts, and shredded coconut.
Evenly distribute your batter between the cupcake liners, filling about 3/4 full. Bake for 18-20 minutes until a toothpick inserted into the center comes out clean. Let the cupcakes cool in the pan for about 10 minutes then transfer them to a cooling rack to cool completely.
To make cream cheese frosting: In the bowl of an electric mixer fitted with paddle attachment, beat butter and cream cheese on medium speed until smooth and creamy. Add sugar and beat until smooth. Scrape down the bowl, add vanilla extract and beat on high speed until completely smooth.
Frost cupcakes with cream cheese frosting once they've cooled, using a piping bag fitted with a tip. Sprinkle with coarsely chopped walnuts or pecans if desired.
Frosted cupcakes can be kept in an airtight container in the refrigerator for up to 4 days. Bring them to room temperature before serving.