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

Get rid of deprecated select syntax

parent f7e87e79
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,8 @@ NULL ...@@ -15,7 +15,8 @@ NULL
#' #'
#' @export #' @export
filterProfitRates = function(rates, classes) { filterProfitRates = function(rates, classes) {
dplyr::filter(.data = rates, .data$profitClass %in% classes) rates %>%
dplyr::filter(profitClass %in% classes)
} }
......
...@@ -283,10 +283,10 @@ getContractBlockPremiums = function(contract) { ...@@ -283,10 +283,10 @@ getContractBlockPremiums = function(contract) {
#' @param costValues Cost definition data structure #' @param costValues Cost definition data structure
costValuesAsDF = function(costValues) { costValuesAsDF = function(costValues) {
as.data.frame.table(costValues, responseName = "Value", stringsAsFactors = TRUE) %>% as.data.frame.table(costValues, responseName = "Value", stringsAsFactors = TRUE) %>%
mutate(Var4 = recode(.data$Var4, "Erl." = "")) %>% mutate(Var4 = recode(Var4, "Erl." = "")) %>%
arrange(.data$Var4, .data$Var2, .data$Var3, .data$Var1) %>% arrange(Var4, Var2, Var3, Var1) %>%
unite("costtype", "Var2", "Var3", "Var4", sep = " ") %>% unite("costtype", "Var2", "Var3", "Var4", sep = " ") %>%
pivot_wider(names_from = .data$costtype, values_from = .data$Value) %>% pivot_wider(names_from = costtype, values_from = Value) %>%
mutate(Var1 = NULL) mutate(Var1 = NULL)
} }
...@@ -350,10 +350,10 @@ exportContractDataTable = function(wb, sheet, contract, ccol = 1, crow = 1, styl ...@@ -350,10 +350,10 @@ exportContractDataTable = function(wb, sheet, contract, ccol = 1, crow = 1, styl
tmp = contractValues %>% tmp = contractValues %>%
mutate(`Initial Capital` = additional_capital) %>% mutate(`Initial Capital` = additional_capital) %>%
select( select(
Vertragsteil = .data$ID, Beginn = .data$`Start of Contract`, Tarif = .data$Tariff, .data$`Sum insured`, Vertragsteil = ID, Beginn = `Start of Contract`, Tarif = Tariff, `Sum insured`,
.data$`Initial Capital`, `Initial Capital`,
.data$`Mortality table`, .data$i, .data$Age, .data$`Policy duration`, .data$`Premium period`, `Mortality table`, i, Age, `Policy duration`, `Premium period`,
.data$`Deferral period`, .data$`Guaranteed payments`) `Deferral period`, `Guaranteed payments`)
writeValuesTable(wb, sheet, values = setInsuranceValuesLabels(tmp), writeValuesTable(wb, sheet, values = setInsuranceValuesLabels(tmp),
caption = "Basisdaten der Vertragsteile", crow = crow, ccol = 1, caption = "Basisdaten der Vertragsteile", crow = crow, ccol = 1,
tableName = "BlocksBasicData", styles = styles) tableName = "BlocksBasicData", styles = styles)
...@@ -365,7 +365,7 @@ exportContractDataTable = function(wb, sheet, contract, ccol = 1, crow = 1, styl ...@@ -365,7 +365,7 @@ exportContractDataTable = function(wb, sheet, contract, ccol = 1, crow = 1, styl
# Unit Premiums #### # Unit Premiums ####
tmp = contractPremiums %>% tmp = contractPremiums %>%
select(Vertragsteil = .data$ID, .data$unit.net, .data$unit.Zillmer, .data$unit.gross) select(Vertragsteil = ID, unit.net, unit.Zillmer, unit.gross)
writeValuesTable(wb, sheet, values = setInsuranceValuesLabels(tmp), writeValuesTable(wb, sheet, values = setInsuranceValuesLabels(tmp),
caption = "Pr\u00e4miens\u00e4tze (auf VS 1)", crow = crow, ccol = 1, caption = "Pr\u00e4miens\u00e4tze (auf VS 1)", crow = crow, ccol = 1,
tableName = "UnitPremiums", styles = styles, valueStyle = styles$unitpremiums) tableName = "UnitPremiums", styles = styles, valueStyle = styles$unitpremiums)
...@@ -373,7 +373,7 @@ exportContractDataTable = function(wb, sheet, contract, ccol = 1, crow = 1, styl ...@@ -373,7 +373,7 @@ exportContractDataTable = function(wb, sheet, contract, ccol = 1, crow = 1, styl
# Yearly Premiums #### # Yearly Premiums ####
tmp = contractPremiums %>% tmp = contractPremiums %>%
select(Vertragsteil = .data$ID, .data$net, .data$Zillmer, .data$gross, .data$written_yearly) select(Vertragsteil = ID, net, Zillmer, gross, written_yearly)
writeValuesTable(wb, sheet, values = setInsuranceValuesLabels(tmp), writeValuesTable(wb, sheet, values = setInsuranceValuesLabels(tmp),
caption = "Jahrespr\u00e4mien", crow = crow, ccol = 1, caption = "Jahrespr\u00e4mien", crow = crow, ccol = 1,
tableName = "YearlyPremiums", styles = styles, valueStyle = styles$currency0) tableName = "YearlyPremiums", styles = styles, valueStyle = styles$currency0)
...@@ -381,7 +381,7 @@ exportContractDataTable = function(wb, sheet, contract, ccol = 1, crow = 1, styl ...@@ -381,7 +381,7 @@ exportContractDataTable = function(wb, sheet, contract, ccol = 1, crow = 1, styl
# Written Premiums #### # Written Premiums ####
tmp = contractPremiums %>% tmp = contractPremiums %>%
select(Vertragsteil = .data$ID, .data$written, .data$unitcost, .data$written_beforetax, .data$tax) select(Vertragsteil = ID, written, unitcost, written_beforetax, tax)
writeValuesTable(wb, sheet, values = setInsuranceValuesLabels(tmp), writeValuesTable(wb, sheet, values = setInsuranceValuesLabels(tmp),
caption = "Pr\u00e4mien (pro Zahlungsweise)", crow = crow, ccol = 1, caption = "Pr\u00e4mien (pro Zahlungsweise)", crow = crow, ccol = 1,
tableName = "WrittenPremiums", styles = styles, valueStyle = styles$currency0) tableName = "WrittenPremiums", styles = styles, valueStyle = styles$currency0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment