0

I made a plot for season (summer, spring, autumn and winter) using pollutionRose from the openair package. Here is the code:

library(openair)
Sys.setlocale("LC_TIME", "Portuguese")
pollutionRose(ASS_SO2, pollutant = "SO2", type ="season", cols="jet", main=expression(paste("ASS-SO"[2]*" (µg/ "* m^3* ")")))

I could´t change the language from english to portuguese with Sys.Setlocale in each season plot. How I can modify this? Thanks!

r2evans
  • 141,215
  • 6
  • 77
  • 149
  • The [source code](https://github.com/davidcarslaw/openair) does not appear to have any i18n or similar methods in it for internationalization. Since most of the messages/labels I see (on a cursory look) are hard-coded, I think your best chance is to submit an [issue](https://github.com/davidcarslaw/openair/issues) or hack the code yourself and submit a pull request. (Admittedly, there are a lot of packages that do not implement internationalization ... not a good thing, and admittedly I know little about how to do it well.) – r2evans Sep 16 '20 at 02:53

1 Answers1

0

You can sort according to the season and then change the labels manually.

library(openair)
ASS_SO2_new <- cutData(ASS_SO2, type = "season")
levels(ASS_SO2_new$season) <- c("primavera", "verao", "cair", "inverno")
pollutionRose(ASS_SO2_new, pollutant = "SO2", type ="season", cols="jet", main=expression(paste("ASS-SO"[2]*" (µg/ "* m^3* ")")))
Novvier
  • 275
  • 1
  • 7