add R plot code