Skip to content
Snippets Groups Projects
Commit 28314d93 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

plotMortalityTables: Ignore 0 only for log-plots

parent e567b08c
No related branches found
No related tags found
No related merge requests found
...@@ -58,12 +58,14 @@ plotMortalityTables = function( ...@@ -58,12 +58,14 @@ plotMortalityTables = function(
if (missing(xlab)) xlab = "Alter"; if (missing(xlab)) xlab = "Alter";
if (missing(ylab)) ylab = expression(paste("Sterbewahrscheinlichkeit ", q[x])); if (missing(ylab)) ylab = expression(paste("Sterbewahrscheinlichkeit ", q[x]));
data = subset(data, y > 0)
if (!is.null(ages)) { if (!is.null(ages)) {
data = data[data$x %in% ages,] data = data[data$x %in% ages,]
} }
pl = ggplot(subset(data, y > 0), aes(x = x, y = y, color = group)) if (log) {
data = subset(data, y > 0)
}
pl = ggplot(data, aes(x = x, y = y, color = group))
if (!is.null(aes)) { if (!is.null(aes)) {
pl = pl + aes pl = pl + aes
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment