Control Concentration Levels in Windrose

Hello Everyone.

Does anyone know how to control the concentration levels in the windrose?

windRose(mydata, type = "pm10", layout = c(4, 1))

This example, PM10, has the following levels in each figure:

Is there any way to control these levels?


the documentation explains

type determines how the data are split i.e. conditioned, and then plotted. The default is will produce a single plot using the entire data. Type can be one of the built-in types as detailed in cutData e.g. “season”, “year”, “weekday” and so on. For example, type = "season" will produce four plots — one for each season.

It is also possible to choose type as another variable in the data frame. If that variable is numeric, then the data will be split into four quantiles (if possible) and labelled accordingly. If type is an existing character or factor variable, then those categories/levels will be used directly. This offers great flexibility for understanding the variation of different variables and how they depend on one another.

^^^ what you are doing

Type can be up length two e.g. type = c("season", "weekday") will produce a 2x2 plot split by season and day of the week. Note, when two types are provided the first forms the columns and the second the rows.


mydata2 <- dplyr::mutate(mydata,
                         pm10x = factor(
                           dplyr::case_when(pm10 < 8 ~ "LT 8",
                                     pm10 <100 ~ "GE8 LT100",
                                     TRUE ~ "GE100"),
                               levels = c("LT 8",
                                      "GE8 LT100",
windRose(mydata2, type =  "pm10x", layout = c(4, 1))

Thank you for sharing this code. Works great!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.