Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
R - Mortality Tables
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
R
R - Mortality Tables
Commits
2dd8ac4e
Commit
2dd8ac4e
authored
Feb 04, 2018
by
Reinhold Kainhofer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plotMortalityTables: Add legend.title argument, ignore NA points in the lines
parent
15e4e74b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
R/plotMortalityTables.R
R/plotMortalityTables.R
+3
-3
man/plotMortalityTables.Rd
man/plotMortalityTables.Rd
+3
-3
No files found.
R/plotMortalityTables.R
View file @
2dd8ac4e
...
...
@@ -14,7 +14,7 @@
#'
#' @import scales
#' @export
plotMortalityTables
=
function
(
data
,
...
,
xlim
=
NULL
,
ylim
=
NULL
,
xlab
=
NULL
,
ylab
=
NULL
,
title
=
""
,
legend.position
=
c
(
0.9
,
0.1
),
legend.key.width
=
unit
(
25
,
"mm"
))
{
plotMortalityTables
=
function
(
data
,
...
,
legend.title
=
"Sterbetafel"
,
xlim
=
NULL
,
ylim
=
NULL
,
xlab
=
NULL
,
ylab
=
NULL
,
title
=
""
,
legend.position
=
c
(
0.9
,
0.1
),
legend.key.width
=
unit
(
25
,
"mm"
))
{
if
(
!
is.data.frame
(
data
))
{
data
=
makeQxDataFrame
(
data
,
...
);
}
...
...
@@ -33,7 +33,7 @@ plotMortalityTables = function(data, ..., xlim=NULL, ylim=NULL, xlab=NULL, ylab=
legend.key.width
=
legend.key.width
,
legend.background
=
element_rect
(
colour
=
"gray50"
,
linetype
=
"solid"
)
)
+
geom_line
()
+
geom_line
(
na.rm
=
TRUE
)
+
scale_y_log10
(
name
=
ylab
,
breaks
=
scales
::
trans_breaks
(
'log10'
,
function
(
x
)
10
^
x
),
...
...
@@ -50,7 +50,7 @@ plotMortalityTables = function(data, ..., xlim=NULL, ylim=NULL, xlab=NULL, ylab=
)
+
coord_cartesian
(
xlim
=
xlim
,
ylim
=
ylim
)
+
annotation_logticks
(
sides
=
"lr"
)
+
xlab
(
"Alter"
)
+
labs
(
colour
=
"Sterbetafel"
);
xlab
(
"Alter"
)
+
labs
(
colour
=
legend.title
,
shape
=
legend.title
);
if
(
title
!=
""
)
{
pl
=
pl
+
ggtitle
(
title
);
}
...
...
man/plotMortalityTables.Rd
View file @
2dd8ac4e
...
...
@@ -4,9 +4,9 @@
\alias{plotMortalityTables}
\title{Plot multiple mortality tables (life tables) in one plot}
\usage{
plotMortalityTables(data, ...,
xlim = NULL, ylim = NULL, xlab
= NULL,
yl
ab = NULL, title = "", legend.position = c(0.9, 0.1)
,
legend.key.width = unit(25, "mm"))
plotMortalityTables(data, ...,
legend.title = "Sterbetafel", xlim
= NULL,
yl
im = NULL, xlab = NULL, ylab = NULL, title = ""
,
legend.
position = c(0.9, 0.1), legend.
key.width = unit(25, "mm"))
}
\arguments{
\item{data}{First life table to be plotted. Either a \code{data.frame} generated by \code{makeQxDataFrame} or a \code{mortalityTable} object}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment