From 72df9738ccccbe8385cd601ef866f2efdcc3417f Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer <reinhold@kainhofer.com> Date: Wed, 25 Aug 2021 19:12:11 +0200 Subject: [PATCH] Fix vignette build and CRAN checks --- DESCRIPTION | 4 ++-- R/exportInsuranceContract_xlsx.R | 4 ++-- man/costValuesAsDF.Rd | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b890141..40d7420 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -30,6 +30,8 @@ Imports: stringr, methods, rlang, + kableExtra, + pander, tidyr License: GPL (>= 2) RoxygenNote: 7.1.1 @@ -48,8 +50,6 @@ Collate: Suggests: knitr, rmarkdown, - pander, - kableExtra, magrittr, tibble, testthat diff --git a/R/exportInsuranceContract_xlsx.R b/R/exportInsuranceContract_xlsx.R index 5e20f6c..3063f2b 100644 --- a/R/exportInsuranceContract_xlsx.R +++ b/R/exportInsuranceContract_xlsx.R @@ -280,12 +280,12 @@ getContractBlockPremiums = function(contract) { #' Convert the array containing cost values like cashflows, present #' values, etc. (objects of dimension tx5x3) to a matrix with dimensions (tx15) #' -#' #parameter costValues Cost definition data structure +#' @param costValues Cost definition data structure costValuesAsDF = function(costValues) { as.data.frame.table(costValues, responseName = "Value", stringsAsFactors = TRUE) %>% mutate(Var4 = recode(.data$Var4, "Erl." = "")) %>% arrange(.data$Var4, .data$Var2, .data$Var3, .data$Var1) %>% - unite(.data$costtype, .data$Var2, .data$Var3, .data$Var4, sep = " ") %>% + unite("costtype", "Var2", "Var3", "Var4", sep = " ") %>% pivot_wider(names_from = .data$costtype, values_from = .data$Value) %>% mutate(Var1 = NULL) } diff --git a/man/costValuesAsDF.Rd b/man/costValuesAsDF.Rd index 18c20ba..babe964 100644 --- a/man/costValuesAsDF.Rd +++ b/man/costValuesAsDF.Rd @@ -6,6 +6,9 @@ \usage{ costValuesAsDF(costValues) } +\arguments{ +\item{costValues}{Cost definition data structure} +} \description{ Convert the cost values array to a tx15 matrix } @@ -13,6 +16,4 @@ Convert the cost values array to a tx15 matrix Not to be called directly, but implicitly by the \link{InsuranceContract} object. Convert the array containing cost values like cashflows, present values, etc. (objects of dimension tx5x3) to a matrix with dimensions (tx15) - -#parameter costValues Cost definition data structure } -- GitLab