adding r code