I hope you didnt go to bed yet Kev. You can just paste in R studio and hit run. Let me know what you think.What you are really looking for in an earnings calendar is the event priced differently in the two options by a large enough amount to overcome expected transaction costs. Is that how you are analyzing them?
Post the code here, publicly. That way others can learn from the discussion also. I, and others, will probably comment on it. I've been reading R since before it existed.