add r script to generate the figures