I'm no R expert, but I'll leave your question here in case an R expert comes along and can help…