add R codes and new plots