R codes for a variety of projects