I'm working on a package that needs to run slightly differently depending on different operating systems, and now versions of OS by the looks.
I'm wondering what the best way to check for different OS versions is?
I know that I can find some System information using
Sys.info() and various combinations of the output from that. Is this the best (most reliable) way to get the OS version? I'm especially interested in detecting when a machine is running macOS Monterey. It seems that
"21.x.x" for macOS Monterey, and
"20.x.x" for Big Sur, but I have limited access to macOS, so it's difficult for me to test this.