Create R Code for Charts