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?
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?