Adding R directory
Modified R files
Working example in R