Preheat the oven to 350ºF.
Beat the sugar, oil, and vanilla together in the bowl of an electric mixer fitted with a paddle attachment. Add the eggs, 1 at a time.
In another bowl, sift together the flour, cinnamon, baking soda, and salt. With the mixer on low speed, add 1/2 of the dry ingredients to the wet ingredients. Add the grated carrots, raisins, and walnuts to the remaining flour, mix well, and add to the batter. Mix until just combined.
Line muffin pans with paper liners.
Scoop the batter into 22 muffin cups until each is 3/4 full.
Bake at 400ºF. for 10 minutes then reduce oven temperature to 350ºF. and cook for a further 35 minutes, until a toothpick comes out clean. Cool on a rack.
For the frosting, cream the cream cheese, butter, and vanilla in the bowl of an electric mixer fitted with a paddle attachment. Add the sugar and beat until smooth. When the cupcakes are cool, frost them generously and serve.