The coordinates you want to project on should be handed to the function as an array of integers, so use "[" instead of "{". You also don't need to specify the homogenization coordinate, it will be preserved automatically. Your example should work if you use $R=projection($P,[1,2,...