X-Git-Url: https://git.auder.net/?a=blobdiff_plain;ds=sidebyside;f=pkg%2FR%2Fplot.R;h=7b5f2b5d599f9556a32b1ddbf68ee3f304990fcc;hb=841b7f5a10742afa28707ebf7dca273b38d8b8e4;hp=e4147986d6432dae8733be59cf01a947f44b3cea;hpb=16b1c049a9c402544d7076cacfe6b00a3785b51f;p=talweg.git diff --git a/pkg/R/plot.R b/pkg/R/plot.R index e414798..7b5f2b5 100644 --- a/pkg/R/plot.R +++ b/pkg/R/plot.R @@ -8,12 +8,12 @@ #' @export plotCurves <- function(data, indices=seq_len(data$getSize())) { - yrange = quantile( range( sapply( indices, function(i) { + yrange = quantile( sapply( indices, function(i) { serie = c(data$getCenteredSerie(i)) if (!all(is.na(serie))) range(serie, na.rm=TRUE) c() - }) ), probs=c(0.05,0.95) ) + }), probs=c(0.05,0.95) ) par(mar=c(4.7,5,1,1), cex.axis=1.5, cex.lab=1.5) for (i in seq_along(indices)) { @@ -75,7 +75,7 @@ computeFilaments <- function(data, index, limit=60, plot=TRUE) sqrt( sum( (ref_serie - data$getCenteredSerie(i))^2 ) / L ) }) indices = sort(distances, index.return=TRUE)$ix[1:min(limit,length(distances))] - yrange = quantile( range( ref_serie, sapply( indices, function(i) { + yrange = quantile( c(ref_serie, sapply( indices, function(i) { ii = fdays_indices[i] serie = c(data$getCenteredSerie(ii), data$getCenteredSerie(ii+1)) if (!all(is.na(serie)))