+#' @title plot curves
+#'
+#' @description Plot a range of curves in data
+#'
+#' @param data Object of class Data
+#' @param indices Range of indices (integers or dates)
+#'
+#' @export
+plotCurves <- function(data, indices)
+{
+ yrange = range( sapply( indices, function(i) {
+ serie = c(data$getCenteredSerie(i))
+ if (!all(is.na(serie)))
+ range(serie, na.rm=TRUE)
+ c()
+ }) )
+ par(mar=c(4.7,5,1,1), cex.axis=1.5, cex.lab=1.5)
+ for (i in seq_along(indices))
+ {
+ plot(data$getSerie(indices[i]), type="l", ylim=yrange,
+ xlab=ifelse(i==1,"Temps (en heures)",""), ylab=ifelse(i==1,"PM10",""))
+ if (ii < length(indices))
+ par(new=TRUE)
+ }
+}
+
#' @title plot measured / predicted
#'
#' @description Plot measured curve (in black) and predicted curve (in red)
index = i - first_day + 1
serie = c(data$getCenteredSerie(index), data$getCenteredSerie(index+1))
if (!all(is.na(serie)))
- return ( range(serie, na.rm=TRUE) )
- return (0)
+ range(serie, na.rm=TRUE)
+ c()
}) )
grays = gray.colors(20, 0.1, 0.9) #TODO: 20 == magic number
colors = c(