From d96e3c5ed8bcb15057442fc88a06036851981059 Mon Sep 17 00:00:00 2001 From: Jens Sauer Date: Wed, 18 Nov 2020 10:26:45 +0100 Subject: [PATCH] utils: Move library() calls to beginning of file It seems that calling library() within a function may fail silently. Moving them out of the function at the beginning of utils.R fixes this. One particular place, where all necessary libraries are loaded, seem to be a much easier way than inside a function. --- utils.R | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/utils.R b/utils.R index 33568de..015197f 100644 --- a/utils.R +++ b/utils.R @@ -3,6 +3,10 @@ # License: GPL version 3 # Jens Mathis Sauer (c) 2020 +library(survival) +library(survminer) +library(tidyverse) + # # Write plot to filename # @@ -95,12 +99,6 @@ sma_break.time.by = 5 * 365.25 sma_init <- function() { if (exists("sma_initialized") == FALSE) { print("Initialize secMalASCT workspace") - - print("Loading libraries") - library(survival) - library(survminer) - library(tidyverse) - print("Loading data") # # Use superassignment operator '<<-' to make