add R codes and plot's