R: mute output of Sys.setlocale()
Assign it or wrap in invisible(.)
:
Sys.setlocale("LC_TIME", "English_United States.1252")
# [1] "English_United States.1252"
invisible(Sys.setlocale("LC_TIME", "English_United States.1252"))
ign <- Sys.setlocale("LC_TIME", "English_United States.1252")
While this function does have side-effect, it also returns the new value. Since it is doing partial-matching to find the best, the return value is not always the same as the argument provided. For instance,
Sys.setlocale("LC_TIME", "English")
# [1] "English_United States.1252"
shows what I wanted and what I got ... so the most-paranoid approach might be to make sure you got what you requested (in case the partial-matching is over-eager). I've never been in a situation where that level of paranoia was required, but then again I'm fortunate that all of my work is in a single language (my primary language) with no multi-lingual users.