Hi, and welcome!
Thanks for the contribution. We who are on macOS pay a price to hang on to all the polished conveniences and consistent conventions. This is a great example.
FYI for any coding questions: Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers.