aboutsummaryrefslogtreecommitdiff
path: root/pkg
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
parentc6e57ab29170266b3038b01c54bf161ab361d440 (diff)
Make quarterly labels for plot.TOXSWA_cwa
Diffstat (limited to 'pkg')
-rw-r--r--pkg/DESCRIPTION4
-rw-r--r--pkg/R/TOXSWA_cwa.R11
2 files changed, 11 insertions, 4 deletions
diff --git a/pkg/DESCRIPTION b/pkg/DESCRIPTION
index 08afb22..a6880f2 100644
--- a/pkg/DESCRIPTION
+++ b/pkg/DESCRIPTION
@@ -1,8 +1,8 @@
Package: pfm
Type: Package
Title: Utilities for pesticide fate modelling
-Version: 0.1-2
-Date: 2015-04-24
+Version: 0.1-3
+Date: 2015-05-07
Authors@R: person("Johannes Ranke", email = "jranke@uni-bremen.de",
role = c("aut", "cre", "cph"))
Description: Utilities for simple PEC calculations and for dealing with data
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