diff --git a/R/plot.R b/R/plot.R index b69ec73..6530131 100644 --- a/R/plot.R +++ b/R/plot.R @@ -54,7 +54,7 @@ #' @param aggregate #' When multiple elements are selected, should the data be aggregated. If #' "none", each element is represented separetly. If "mean" values are -#' averaged and if "sum" they are added. You can also compute mean ans sum by areas. +#' averaged and if "sum" they are added. You can also compute mean and sum by variable. #' @param colors #' Vector of colors #' @param ylab @@ -193,7 +193,7 @@ tsPlot <- function(x, confInt = 0, minValue = NULL, maxValue = NULL, - aggregate = c("none", "mean", "sum", "mean by areas", "sum by areas"), + aggregate = c("none", "mean", "sum", "mean by variable", "sum by variable"), compare = NULL, compareOpts = list(), interactive = getInteractivity(), @@ -818,12 +818,12 @@ tsPlot <- function(x, ), aggregate = mwSelect({ - tmp <- c("none", "mean", "sum", "mean by areas", "sum by areas") + tmp <- c("none", "mean", "sum", "mean by variable", "sum by variable") names(tmp) <- c(.getLabelLanguage("none", language), .getLabelLanguage("mean", language), .getLabelLanguage("sum", language), - .getLabelLanguage("mean by areas", language), - .getLabelLanguage("sum by areas", language)) + .getLabelLanguage("mean by variable", language), + .getLabelLanguage("sum by variable", language)) tmp }, value ={ if(.initial) aggregate diff --git a/R/plot_utils.R b/R/plot_utils.R index 953845c..67e7843 100644 --- a/R/plot_utils.R +++ b/R/plot_utils.R @@ -16,7 +16,7 @@ .getTSData <- function(x, tpl, variable, elements, uniqueElement = unique(tpl$element), mcYear = NULL, - dateRange = NULL, aggregate = c("none", "mean", "sum", "mean by areas", "sum by areas"), + dateRange = NULL, aggregate = c("none", "mean", "sum", "mean by variable", "sum by variable"), typeConfInt = FALSE) { if (length(variable) == 0){return(tpl[0])} @@ -43,7 +43,7 @@ tpl <- rbindlist(listVar) elements <- as.vector(sapply(elements, function(X){paste(X, "__", variable)})) }else{ - if (aggregate %in% c("mean by areas", "sum by areas")){ + if (aggregate %in% c("mean by variable", "sum by variable")){ tpl <- listVar[[1]][, element := paste(element, "__", names(listVar)[1])] elements <- paste(elements, "__", variable) } else { @@ -87,14 +87,14 @@ tpl <- tpl[, .(element = as.factor("Sum"), value = sum(value)), by = c(.idCols(tpl))] } - } else if (aggregate == "mean by areas"){ + } else if (aggregate == "mean by variable"){ tpl$areas <- unlist(lapply(strsplit(tpl$element, "__"), function(X) X[1])) tpl$element <- unlist(lapply(strsplit(tpl$element, "__"), function(X) X[2])) tpl <- tpl[, .(value = mean(value)), by = c(.idCols(tpl), "element")] - } else if (aggregate == "sum by areas"){ + } else if (aggregate == "sum by variable"){ tpl$areas <- unlist(lapply(strsplit(tpl$element, "__"), function(X) X[1])) tpl$element <- unlist(lapply(strsplit(tpl$element, "__"), function(X) X[2])) diff --git a/inst/language_labels.csv b/inst/language_labels.csv index 867f13e..f1d3e19 100644 --- a/inst/language_labels.csv +++ b/inst/language_labels.csv @@ -27,8 +27,8 @@ aggregate;Agrégation none;sans mean;moyenne sum;somme -mean by areas;moyenne par nœud -sum by areas;somme par nœud +mean by variable;moyenne par variable +sum by variable;somme par variable highlight;Surbrillance Color;Couleur Size;Taille diff --git a/man/tsPlot.Rd b/man/tsPlot.Rd index c5eaefa..03755d8 100644 --- a/man/tsPlot.Rd +++ b/man/tsPlot.Rd @@ -21,7 +21,7 @@ tsPlot( confInt = 0, minValue = NULL, maxValue = NULL, - aggregate = c("none", "mean", "sum", "mean by areas", "sum by areas"), + aggregate = c("none", "mean", "sum", "mean by variable", "sum by variable"), compare = NULL, compareOpts = list(), interactive = getInteractivity(), @@ -61,7 +61,7 @@ tsPlot( confInt = 0, minValue = NULL, maxValue = NULL, - aggregate = c("none", "mean", "sum", "mean by areas", "sum by areas"), + aggregate = c("none", "mean", "sum", "mean by variable", "sum by variable"), compare = NULL, compareOpts = list(), interactive = getInteractivity(), @@ -101,7 +101,7 @@ tsPlot( confInt = 0, minValue = NULL, maxValue = NULL, - aggregate = c("none", "mean", "sum", "mean by areas", "sum by areas"), + aggregate = c("none", "mean", "sum", "mean by variable", "sum by variable"), compare = NULL, compareOpts = list(), interactive = getInteractivity(), @@ -141,7 +141,7 @@ tsPlot( confInt = 0, minValue = NULL, maxValue = NULL, - aggregate = c("none", "mean", "sum", "mean by areas", "sum by areas"), + aggregate = c("none", "mean", "sum", "mean by variable", "sum by variable"), compare = NULL, compareOpts = list(), interactive = getInteractivity(), @@ -228,7 +228,7 @@ values are displayed.} \item{aggregate}{When multiple elements are selected, should the data be aggregated. If "none", each element is represented separetly. If "mean" values are -averaged and if "sum" they are added. You can also compute mean ans sum by areas.} +averaged and if "sum" they are added. You can also compute mean and sum by variable.} \item{compare}{An optional character vector containing names of parameters. When it is set, two charts are outputed with their own input controls. Alternatively, it can