11 Commits

Author SHA1 Message Date
30c03f01d0 Remove unused factor levels from data after limiting
After limiting the data there may be factors with empty levels. This can
be confusing and should be avoided.
2020-11-19 13:16:34 +01:00
2a67cecf0a Use data from repository
Starting with this commit, all calculation will base on data/data.csv.
2020-11-17 19:49:22 +01:00
5e7b6007f1 Introduce initialization function
sma_init() can now be used to load all libraries and the data.
It is safe to call sma_init() multiple times. To forcefully reload the
data call sma_init_force().
2020-11-17 18:17:40 +01:00
b81756310b utils: Filter all hematologic patients
At this time only solid tumors are important. This is a hard coded
switch, not very useful. But it get the job done and we can decide later
how this can be made better.
2020-11-17 15:12:58 +01:00
c68e536861 utils: Filter patient by age
The minimum age for this study is 16.0 years or older at time of
transplantation.
2020-11-17 15:05:31 +01:00
3c160c37bb Set global break.time.by value for ggsurvplot
Substitute manual "break.time.by" values with global which can be used
by all plots.
2020-11-17 14:32:59 +01:00
12ffcd4e38 survival: Change plot function to ggsurvplot
This will create the plot using the ggsurvplot from "survminer" package.
survminer user ggplot for plotting and comes with some powerful and nice
looking features.
2020-11-17 12:58:51 +01:00
c3fecc1bf0 survival: Create functions for plots
Each plot has now its own function. This makes it easier to adjust the
creation and tweaking of a single plot. sma_plot_file() will now call
the individual plot function before saveing the plot.
2020-11-16 22:38:07 +01:00
f919a31527 utils: Add sma_load_data()
This function loads the data and adjust some wrong column types. It
shoulb be used from all other scripts to load the data. It the same
source data for all following calculations.
The data is stored inside a 'tibble' from the 'tidyverse' package.
2020-11-16 12:24:20 +01:00
815731cbcf utils: Hide garbage output from dev.off()
dev.off() prints not usefull messages like "null device 1" when
finishing. This supresses these messages.
2020-11-03 16:55:29 +01:00
a8c4b327a0 Introduce plot to file function
sma_plot_file(fname, ftype, title_list, legend_list, fun, ...)
can be used to write plot to a file.
It supports all output filetypes R can handle. Title and legend
arguments can be passed as lists.
All available plotting functions can be used, arguments go into a
variable argument list.
2020-10-22 18:29:13 +02:00