R implementation

IN PROGRESS