Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IEAtoolsMOVEDTOGITHUB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Otto, Dr. Saskia
IEAtoolsMOVEDTOGITHUB
Commits
6fd48f38
Commit
6fd48f38
authored
4 years ago
by
Otto, Dr. Saskia
Browse files
Options
Downloads
Patches
Plain Diff
some minor changes in the order of arguments
parent
f1aa60b3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
R/trafficlight.R
+13
-14
13 additions, 14 deletions
R/trafficlight.R
man/trafficlight.Rd
+24
-21
24 additions, 21 deletions
man/trafficlight.Rd
with
37 additions
and
35 deletions
R/trafficlight.R
+
13
−
14
View file @
6fd48f38
...
@@ -8,14 +8,8 @@
...
@@ -8,14 +8,8 @@
#' @param time vector of time units that will be used for the x axis.
#' @param time vector of time units that will be used for the x axis.
#' @param sort_5yrmean logical; should the variables be sorted by the first 5yr mean? Default
#' @param sort_5yrmean logical; should the variables be sorted by the first 5yr mean? Default
#' is set to TRUE.
#' is set to TRUE.
#' @param sort_vec
I
f specific order of variable is desired the sorting index should be
#' @param sort_vec
integer vector; i
f specific order of variable is desired the sorting index should be
#' provided here.
#' provided here.
#' @param main A title.
#' @param xlab The x axis title. Default is none.
#' @param ylab The y axis title. Default is none.
#' @param adj_xlab integer; vertical adjustment of the x axis title.
#' @param adj_ylab integer; horizontal adjustment of the y axis title.
#' @param cols A character vector with colors for each quantile or interval.
#' @param method character; the type of methods to create the color code. Choose
#' @param method character; the type of methods to create the color code. Choose
#' between using "quantiles" (default) or "intervals".
#' between using "quantiles" (default) or "intervals".
#' @param probs a vector of probabilities to calculate the quantiles using the function
#' @param probs a vector of probabilities to calculate the quantiles using the function
...
@@ -25,10 +19,16 @@
...
@@ -25,10 +19,16 @@
#' @param quantile_type an integer between 1 and 9 selecting one of the nine quantile
#' @param quantile_type an integer between 1 and 9 selecting one of the nine quantile
#' algorithms detailed below to be used. Default is 7 (see also \code{\link{quantile}}).
#' algorithms detailed below to be used. Default is 7 (see also \code{\link{quantile}}).
#' @param intervals logical; number of evenly-spaced intervals. Default is 5.
#' @param intervals logical; number of evenly-spaced intervals. Default is 5.
#' @param cols a character vector with colors for each quantile or interval.
#' @param main a title.
#' @param xlab The x axis title. Default is none.
#' @param ylab The y axis title. Default is none.
#' @param adj_xlab integer; vertical adjustment of the x axis title.
#' @param adj_ylab integer; horizontal adjustment of the y axis title.
#' @param hadj_x double; horizontal adjustment of the x labels.
#' @param hadj_x double; horizontal adjustment of the x labels.
#' @param vadj_x double; vertical adjustment of the x labels.
#' @param vadj_x double; vertical adjustment of the x labels.
#' @param hadj_y double; horizontal adjustment of the
x
labels.
#' @param hadj_y double; horizontal adjustment of the
y
labels.
#' @param vadj_y double; vertical adjustment of the
x
labels.
#' @param vadj_y double; vertical adjustment of the
y
labels.
#' @param madj_bottom double; adjustment of bottom margin relative to the
#' @param madj_bottom double; adjustment of bottom margin relative to the
#' current setting.
#' current setting.
#' @param madj_left double; adjustment of left margin relative to the
#' @param madj_left double; adjustment of left margin relative to the
...
@@ -58,20 +58,19 @@
...
@@ -58,20 +58,19 @@
#' @param respect logical; this argument controls whether a unit column-width is the
#' @param respect logical; this argument controls whether a unit column-width is the
#' same physical measurement on the device as a unit row-height (default is TRUE).
#' same physical measurement on the device as a unit row-height (default is TRUE).
#'
#'
#'
#' @export
#' @export
#' @author Saskia A. Otto
#' @examples
#' @examples
#' df <- data.frame(
aaaaaaaa = 1:20, bbbbbbbbbb
= rnorm(20, 100, 30),
c
= 1:20 + rnorm(20))
#' df <- data.frame(
variable1 = 1:20, variable2
= rnorm(20, 100, 30),
variable3
= 1:20 + rnorm(20))
#' trafficlight(x = df, time = 1981:2000)
#' trafficlight(x = df, time = 1981:2000)
#' df <- matrix(rnorm(100), ncol = 5)
#' df <- matrix(rnorm(100), ncol = 5)
#' colnames(df) <- letters[1:5]
#' colnames(df) <- letters[1:5]
#' trafficlight(x = df, time = 1981:2000, legend_pos = "bottom", method = "intervals")
#' trafficlight(x = df, time = 1981:2000, legend_pos = "bottom", method = "intervals")
trafficlight
<-
function
(
x
,
time
=
NULL
,
sort_5yrmean
=
TRUE
,
sort_vec
=
NULL
,
trafficlight
<-
function
(
x
,
time
=
NULL
,
sort_5yrmean
=
TRUE
,
sort_vec
=
NULL
,
m
ain
=
""
,
xlab
=
""
,
ylab
=
""
,
adj_xlab
=
NULL
,
adj_ylab
=
NULL
,
m
ethod
=
"quantiles"
,
probs
=
seq
(
0
,
1
,
0.2
),
quantile_type
=
7
,
intervals
=
5
,
cols
=
c
(
"green"
,
"yellowgreen"
,
"yellow"
,
"gold"
,
"red"
),
cols
=
c
(
"green"
,
"yellowgreen"
,
"yellow"
,
"gold"
,
"red"
),
method
=
"quantiles"
,
main
=
""
,
xlab
=
""
,
ylab
=
""
,
adj_xlab
=
NULL
,
adj_ylab
=
NULL
,
probs
=
seq
(
0
,
1
,
0.2
),
quantile_type
=
7
,
intervals
=
5
,
hadj_x
=
0.5
,
vadj_x
=
-0.7
,
hadj_y
=
-0.7
,
vadj_y
=
0.3
,
hadj_x
=
0.5
,
vadj_x
=
-0.7
,
hadj_y
=
-0.7
,
vadj_y
=
0.3
,
madj_bottom
=
0
,
madj_left
=
0
,
madj_top
=
0
,
madj_right
=
0
,
madj_bottom
=
0
,
madj_left
=
0
,
madj_top
=
0
,
madj_right
=
0
,
legend_pos
=
"top"
,
legend_intersp_x
=
1
,
legend_intersp_y
=
1
,
legend_pos
=
"top"
,
legend_intersp_x
=
1
,
legend_intersp_y
=
1
,
...
...
This diff is collapsed.
Click to expand it.
man/trafficlight.Rd
+
24
−
21
View file @
6fd48f38
...
@@ -9,16 +9,16 @@ trafficlight(
...
@@ -9,16 +9,16 @@ trafficlight(
time = NULL,
time = NULL,
sort_5yrmean = TRUE,
sort_5yrmean = TRUE,
sort_vec = NULL,
sort_vec = NULL,
method = "quantiles",
probs = seq(0, 1, 0.2),
quantile_type = 7,
intervals = 5,
cols = c("green", "yellowgreen", "yellow", "gold", "red"),
main = "",
main = "",
xlab = "",
xlab = "",
ylab = "",
ylab = "",
adj_xlab = NULL,
adj_xlab = NULL,
adj_ylab = NULL,
adj_ylab = NULL,
cols = c("green", "yellowgreen", "yellow", "gold", "red"),
method = "quantiles",
probs = seq(0, 1, 0.2),
quantile_type = 7,
intervals = 5,
hadj_x = 0.5,
hadj_x = 0.5,
vadj_x = -0.7,
vadj_x = -0.7,
hadj_y = -0.7,
hadj_y = -0.7,
...
@@ -49,21 +49,9 @@ trafficlight(
...
@@ -49,21 +49,9 @@ trafficlight(
\item{sort_5yrmean}{logical; should the variables be sorted by the first 5yr mean? Default
\item{sort_5yrmean}{logical; should the variables be sorted by the first 5yr mean? Default
is set to TRUE.}
is set to TRUE.}
\item{sort_vec}{
I
f specific order of variable is desired the sorting index should be
\item{sort_vec}{
integer vector; i
f specific order of variable is desired the sorting index should be
provided here.}
provided here.}
\item{main}{A title.}
\item{xlab}{The x axis title. Default is none.}
\item{ylab}{The y axis title. Default is none.}
\item{adj_xlab}{integer; vertical adjustment of the x axis title.}
\item{adj_ylab}{integer; horizontal adjustment of the y axis title.}
\item{cols}{A character vector with colors for each quantile or interval.}
\item{method}{character; the type of methods to create the color code. Choose
\item{method}{character; the type of methods to create the color code. Choose
between using "quantiles" (default) or "intervals".}
between using "quantiles" (default) or "intervals".}
...
@@ -77,13 +65,25 @@ algorithms detailed below to be used. Default is 7 (see also \code{\link{quantil
...
@@ -77,13 +65,25 @@ algorithms detailed below to be used. Default is 7 (see also \code{\link{quantil
\item{intervals}{logical; number of evenly-spaced intervals. Default is 5.}
\item{intervals}{logical; number of evenly-spaced intervals. Default is 5.}
\item{cols}{a character vector with colors for each quantile or interval.}
\item{main}{a title.}
\item{xlab}{The x axis title. Default is none.}
\item{ylab}{The y axis title. Default is none.}
\item{adj_xlab}{integer; vertical adjustment of the x axis title.}
\item{adj_ylab}{integer; horizontal adjustment of the y axis title.}
\item{hadj_x}{double; horizontal adjustment of the x labels.}
\item{hadj_x}{double; horizontal adjustment of the x labels.}
\item{vadj_x}{double; vertical adjustment of the x labels.}
\item{vadj_x}{double; vertical adjustment of the x labels.}
\item{hadj_y}{double; horizontal adjustment of the
x
labels.}
\item{hadj_y}{double; horizontal adjustment of the
y
labels.}
\item{vadj_y}{double; vertical adjustment of the
x
labels.}
\item{vadj_y}{double; vertical adjustment of the
y
labels.}
\item{madj_bottom}{double; adjustment of bottom margin relative to the
\item{madj_bottom}{double; adjustment of bottom margin relative to the
current setting.}
current setting.}
...
@@ -134,9 +134,12 @@ This function creates for multiple time series an image plot where the color
...
@@ -134,9 +134,12 @@ This function creates for multiple time series an image plot where the color
code is based on selected quantiles or evenly spaced intervals.
code is based on selected quantiles or evenly spaced intervals.
}
}
\examples{
\examples{
df <- data.frame(
aaaaaaaa = 1:20, bbbbbbbbbb
= rnorm(20, 100, 30),
c
= 1:20 + rnorm(20))
df <- data.frame(
variable1 = 1:20, variable2
= rnorm(20, 100, 30),
variable3
= 1:20 + rnorm(20))
trafficlight(x = df, time = 1981:2000)
trafficlight(x = df, time = 1981:2000)
df <- matrix(rnorm(100), ncol = 5)
df <- matrix(rnorm(100), ncol = 5)
colnames(df) <- letters[1:5]
colnames(df) <- letters[1:5]
trafficlight(x = df, time = 1981:2000, legend_pos = "bottom", method = "intervals")
trafficlight(x = df, time = 1981:2000, legend_pos = "bottom", method = "intervals")
}
}
\author{
Saskia A. Otto
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment