aboutsummaryrefslogtreecommitdiff
path: root/pkg/R/TOXSWA_cwa.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2015-05-07 12:04:28 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2015-05-07 12:04:28 +0200
commit508d883f7689d617d15915dbd26a27f1613bb857 (patch)
tree0711103b7fb8b5389930630af5596e1f70a2fb6c /pkg/R/TOXSWA_cwa.R
parentc6e57ab29170266b3038b01c54bf161ab361d440 (diff)
Make quarterly labels for plot.TOXSWA_cwa
Diffstat (limited to 'pkg/R/TOXSWA_cwa.R')
-rw-r--r--pkg/R/TOXSWA_cwa.R11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkg/R/TOXSWA_cwa.R b/pkg/R/TOXSWA_cwa.R
index bb45a4b..948d7a9 100644
--- a/pkg/R/TOXSWA_cwa.R
+++ b/pkg/R/TOXSWA_cwa.R
@@ -97,8 +97,15 @@ plot.TOXSWA_cwa <- function(x, time_column = c("datetime", "t", "t_firstjan", "t
if (add) {
lines(x$cwas[c(time_column, cwa_column)], xlab = xlab, ylab = ylab, ...)
} else{
- plot(x$cwas[c(time_column, cwa_column)], type = "l",
- xlab = xlab, ylab = ylab, ...)
+ if (time_column == "datetime") {
+ plot(x$cwas$datetime, x$cwas[[cwa_column]], type = "l",
+ xlab = xlab, ylab = ylab, xaxt = "n", ...)
+ seq_x <- seq(min(x$cwas$datetime), max(x$cwas$datetime), by = "quarter")
+ axis(1, at = seq_x, labels = format(seq_x, "%b %Y"))
+ } else {
+ plot(x$cwas[c(time_column, cwa_column)], type = "l",
+ xlab = xlab, ylab = ylab, ...)
+ }
}
tmp <- Sys.setlocale("LC_TIME", lct)
}

Contact - Imprint