How to turn on visibility when you press a key?

One last thing how do I get it to start off invisible as it currently is visible until you press R then it becomes invisible. I want it to be the other way round.