R scripting, mask + label script