R: Clean up demo code