Rcode to extract and clean the data and to construct the various plot