R Language Column wise operation