Completed workflow with R plotting code.