Is it ok to pray in public? Matthew 6:6 (NIV) says:


  But when you pray, go into your room, close the door and pray to your Father, who is unseen. Then your Father, who sees what is done in secret, will reward you.


Does this mean that prayer should only be performed in private? If so, why do christians pray collectively in churches and at other gatherings?
A bit of context (Matthew 6:5-6):


  “And when you pray, do not be like the hypocrites, for they love to pray standing in the synagogues and on the street corners to be seen by others. Truly I tell you, they have received their reward in full. But when you pray, go into your room, close the door and pray to your Father, who is unseen. Then your Father, who sees what is done in secret, will reward you.


It's primarily instructing us to not pray for the intent of showing people that we're praying, as hypocrites do ("see, I'm praying! look how good I am!"). It instead tells us to do what you can to keep it unobtrusive, and if possible, secret.