Uh oh!
There was an error while loading. Please reload this page.
robust to NULL osVersion - #101
Conversation
Hi, thanks for spotting this - I didn't know about the NULL. Sounds like a feature request to R return Here's my train of though. My inner OCD says: osVersion=if (is.null(utils::osVersion)) NAelseutils::osVersion,should be osVersion=if (is.null(utils::osVersion)) NA_character_elseutils::osVersion,My non-inner OCD says: " osVersion=if (is.null(utils::osVersion)) "?"elseutils::osVersion,or just osVersion=if (is.null(utils::osVersion)) ""elseutils::osVersion,? Now, that's a mouth full. What about: osVersion=utils::osVersion %||% "?"Hmm, that requires R (>= 4.4.0), but we tend to have academic HPC users running on old versions of R. Argh... Think think think, "it's just an example" and osVersion= paste0(utils::osVersion, "")? That'll give an empty string in those cases, but no-one will complain. |
MichaelChirico
commented
Oct 10, 2025
Yea, on second thought, maybe it's best to just let this go? Even the The one place I actually encountered this was a testing environment -- only robots are running examples there. And even then it may have just been transient, I wasn't able to reproduce it now, maybe a kernel/OS/policy update got it working again. Some alternatives that can still scratch our itch to be "correct":
Agree |
https://stat.ethz.ch/R-manual/R-devel/library/utils/html/sessionInfo.html
I see this used in a few places -- checking in first before applying it elsewhere that this is something you find useful / the preferred approach for addressing it:
https://github.com/search?q=repo%3Afutureverse%2Ffuture.batchtools%20%2FosVersion%2F&type=code