Three useful (to me) R patterns