As highlighted here : http://stackoverflow.com/questions/24647784/how-to-replace-first-n1-and-last-n2-rows-with-na-in-specific-columns