tlumip / swimr

Visualizations and Reports for SWIM
Other
0 stars 1 forks source link

Short year format for faceted plots #10

Closed rickdonnelly closed 8 years ago

rickdonnelly commented 8 years ago

We use four-digit years in most of our data, which makes sense, given that we have time series data that stretches back into the last century. But when used on the x-axis for faceted plots the years overwrite one another. It would be awesome if our code predicted when that was going to happen and switched to two-digit years (last two digits), but I'd be happy with a swimr function that converts four-digit years into two-character strings (so that "00" and "05" shows up that way). But of course I'd like them to remain in four-digit year order, so am thinking it would be transform of existing factor, where the levels might something like (c(1900:1999, 2000:2099)) or something like that? There may be a base R function that does this already, and if so maybe we generalize the swimr code so that it can handle function return from it as easily as the field name from the data?

gregmacfarlane commented 8 years ago

I think I could probably make them dates, and then that would help keep things nice. http://docs.ggplot2.org/current/scale_date.html

gregmacfarlane commented 8 years ago

The easiest solution for now is to just rotate the axes.