R programs for production and claim analysis