R code and plots related to CP1