Preheat the oven to 350 degrees F and line a muffin pan with paper liners. In a large mixing bowl, cream together the sugar, eggs, coconut oil, applesauce and vanilla. Sift together the flour, baking soda, salt, cinnamon and nutmeg. Add these dry ingredients to the wet ingredients and mix well until combined. Stir in the walnuts, if using. The batter will be very thick. Gently add the diced apples and toss.