Commit ed28715c authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

Merge conflict

refactor: review the x-axis management of the plot.OutputsModel
Refs #122, !6

Merge branch '122-review-the-x-axis-management-of-the-plot-outputsmodel' into dev

# Veuillez entrer un message de validation pour expliquer en quoi cette fusion est
# nécessaire, surtout si cela fusionne une branche amont mise à jour dans une branche de sujet.
#
# Les lignes commençant par '#' seront ignorées, et un message vide
# abandonne la validation.
parents 265725dc 36154a79
Pipeline #24993 passed with stage
in 9 minutes and 4 seconds
......@@ -219,16 +219,41 @@
res
}
.IndexOutputsModel <- function(x, i) {
# '[.OutputsModel' <- function(x, i) {
# if (!inherits(x, "OutputsModel")) {
# stop("'x' must be of class 'OutputsModel'")
# }
# if (is.factor(i)) {
# i <- as.character(i)
# }
# if (is.numeric(i)) {
# .ExtractOutputsModel(x, i)
# } else {
# NextMethod()
# }
# }
if (!inherits(x, "OutputsModel")) {
stop("'x' must be of class 'OutputsModel'")
}
if (is.factor(i)) {
i <- as.character(i)
}
if (is.numeric(i)) {
.ExtractOutputsModel(x, i)
} else {
NextMethod()
}
}
## =================================================================================
## function to try to set local time in English
## =================================================================================
.TrySetLcTimeEN <- function() {
locale <- list("English_United Kingdom",
"en_US",
"en_US.UTF-8",
"en_US.utf8",
"en")
dateTest <- as.POSIXct("2000-02-15", tz = "UTC", format = "%Y-%m-%d")
monthTestTarget <- "February"
monthTest <- function() {
format(dateTest, format = "%B")
}
lapply(locale, function(x) {
if (monthTest() != monthTestTarget) {
Sys.setlocale(category = "LC_TIME", locale = x)
}
})
}
This diff is collapsed.
......@@ -21,6 +21,7 @@ Function which creates a screen plot giving an overview of the model outputs.
\method{plot}{OutputsModel}(x, Qobs = NULL, IndPeriod_Plot = NULL,
BasinArea = NULL, which = "synth", log_scale = FALSE,
cex.axis = 1, cex.lab = 0.9, cex.leg = 0.9, lwd = 1,
AxisTS = function(x) axis.POSIXct(side = 1, x = x$DatesR, ...),
LayoutMat = NULL,
LayoutWidths = rep.int(1, ncol(LayoutMat)),
LayoutHeights = rep.int(1, nrow(LayoutMat)),
......@@ -49,6 +50,8 @@ Function which creates a screen plot giving an overview of the model outputs.
\item{lwd}{(optional) [numeric] the line width (a positive number)}
\item{AxisTS}{(optional) [function] to manage x-axis representing calendar dates and times on time series plots (see \code{\link{axis}} and \code{\link{axis.POSIXct}})}
\item{LayoutMat}{(optional) [numeric] a matrix object specifying the location of the next N figures on the output device. Each value in the matrix must be 0 or a positive integer. If N is the largest positive integer in the matrix, then the integers {1, \dots, N-1} must also appear at least once in the matrix (see \code{\link{layout}})}
\item{LayoutWidths}{(optional) [numeric] a vector of values for the widths of columns on the device (see \code{\link{layout}})}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment