secmalasct/visualize.R
Jens Sauer e0faa24f40 Add basic histograms
This adds some basic histograms to show the distribution of age at
transplatation and year of transplatation.
2020-11-19 19:21:52 +01:00

23 lines
577 B
R

# Visualize basics from data
#
# License: GPL version 3
# Jens Mathis Sauer (c) 2020
source("utils.R")
sma_init()
sma_hist_asct_age <- function() {
data <- data.frame(asct_age = secmal$asct_age)
ggplot(data, aes(x = asct_age)) + geom_histogram(binwidth = 5)
}
sma_hist_asct_year <- function() {
data <- data.frame(asct_year = secmal$asct_year)
ggplot(data, aes(x = asct_year)) + geom_histogram(binwidth = 1)
}
sma_plot_file_hist <- function() {
sma_plot_file("hist_asct_age.png", png, sma_hist_asct_age)
sma_plot_file("hist_asct_year.png", png, sma_hist_asct_year)
}