What is the most elegant way to split data and produce seasonal boxplots?

前端 未结 3 1060
无人及你
无人及你 2021-01-12 17:40

I want to produce seasonal boxplots for a lot of different time series. I hope that the code below clearly illustrates what I want to do.

My question is now, how to

3条回答
  •  我在风中等你
    2021-01-12 18:26

    To set months as ordered factor in any locale settings use a trick which can be found in help page for ?month.abb:

    Sys.setlocale("LC_TIME", "German_Germany")
    DF$month <- factor(format(DF$Time, "%b"), levels=format(ISOdate(2000, 1:12, 1), "%b"))
    

    And you could plot it in lattice as well:

    require(lattice)
    bwplot(Data~month, DF, pch="|") # set pch to nice line instead of point
    

    Lattice boxplot

提交回复
热议问题