From e1ddc29d948731d7c973b42cd7c735d31df17bdc Mon Sep 17 00:00:00 2001 From: fvitalini Date: Thu, 21 Mar 2019 12:22:49 +0100 Subject: [PATCH 01/33] added logo in vignettes issue #101 --- vignettes/smarp_server.Rmd | 7 +++++++ vignettes/smarp_ui.Rmd | 7 +++++++ vignettes/smarp_user_manual.Rmd | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/vignettes/smarp_server.Rmd b/vignettes/smarp_server.Rmd index 2361fcb..9127817 100644 --- a/vignettes/smarp_server.Rmd +++ b/vignettes/smarp_server.Rmd @@ -20,6 +20,13 @@ suppressPackageStartupMessages(library(googleVis)) library(dplyr, warn.conflicts = FALSE) library(magrittr) ``` + +```{r, echo=FALSE} +htmltools::img(src = knitr::image_uri("figures/mirai.png"), + alt = 'logo', + style = 'position:absolute; top:0; right:0; padding:10px; margin-right:200px; max-height: 40px;border-style: none;') +``` + ## Introduction ```{r child = 'children/short-intro.Rmd'} diff --git a/vignettes/smarp_ui.Rmd b/vignettes/smarp_ui.Rmd index 28baf59..33ad1b1 100644 --- a/vignettes/smarp_ui.Rmd +++ b/vignettes/smarp_ui.Rmd @@ -18,6 +18,13 @@ knitr::opts_chunk$set( library(shiny) ``` +```{r, echo=FALSE} +htmltools::img(src = knitr::image_uri("figures/mirai.png"), + alt = 'logo', + style = 'position:absolute; top:0; right:0; padding:10px; margin-right:200px; max-height: 40px;border-style: none;') +``` + + ## Introduction ```{r child = 'children/short-intro.Rmd'} diff --git a/vignettes/smarp_user_manual.Rmd b/vignettes/smarp_user_manual.Rmd index da93826..b59178e 100644 --- a/vignettes/smarp_user_manual.Rmd +++ b/vignettes/smarp_user_manual.Rmd @@ -9,6 +9,12 @@ vignette: > %\VignetteEncoding{UTF-8} --- +```{r, echo=FALSE} +htmltools::img(src = knitr::image_uri("figures/mirai.png"), + alt = 'logo', + style = 'position:absolute; top:0; right:0; padding:10px; margin-right:200px; max-height: 40px;border-style: none;') +``` + ## Introduction ```{r child = 'children/short-intro.Rmd'} From e4de75390fc4eb0141a2c3722f1e745be8eaf1af Mon Sep 17 00:00:00 2001 From: fvitalini Date: Thu, 21 Mar 2019 12:23:26 +0100 Subject: [PATCH 02/33] mirai logo issue #101 --- vignettes/figures/mirai.png | Bin 0 -> 12435 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 vignettes/figures/mirai.png diff --git a/vignettes/figures/mirai.png b/vignettes/figures/mirai.png new file mode 100644 index 0000000000000000000000000000000000000000..5c3096cc6aa157291b5575a6dbfb2f99b3bf9f73 GIT binary patch literal 12435 zcmY+rWk4HI*DZ{M03|p@3KT2W;(_47trQA{BE>aOf)#fwZlzd(V#VFHIK|!FihFPf z_R;5gzxUodKQbq0_StK%J!kf;Ig^B{D9hnKd+`hf1qD|@Uit$H3To+7`wJHE=@ZAB z&;4nK>hM8M5~XyQYWJzFZK5ONiz|Br>xQ~O^xCq39v$pXr*kwn9=fa@N#g`L!Z&o(u#aBH5d9I zE&D&ipT3FGTR1w}32}0|xVUh*fH`cxz&N=D1qC^|csO}@*qlJ$c#nS8v`JaC%x5$4i|DV49!4cv72mXHr^IxX_>3yOKeI~;BziER$ zd)L9Nje^3lqaZDz?uvToHSm40zQXyVqW(3}nvlmrryE*4{CJom+#RhZp+!3X7F#w9 z3|-K$eO$*ZkAV_DUsId@>1ud)%N$7gQLFrkaqDLk|g%7M6 z$VhICA)|6Qvoa5+>If`1AM*7+!cg$-M6t^ZMOZqwm{tIO|KIIj*M@ta~W#LN#UiXJ=&1v3w4 zIN$sLmEuJ?QJge}^4aN`WU~HC1PP%2kIVL#2qip5shcpJ>{=^n1KJrc(59CGCnNoH~7JA=-omg7v&;8r5l9Wl{T=TfY?XHrx-o zTkE#5(X2mH)bWOaWDar_sb0R;hZpu&odBH$))_C}fz)2f$(0^vHYd- zunAV8Out{~Nx|A^^c-)i;mEF`k};ei%r{q?b%y$oy_R#5OHnfeU7`bWK2MvPzwX151Z2aW13@XLSLK;_;nhCx^m1L%+5R zQprJKI@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jKhOc8s2w zcAtgH068+~ZNqq>!)=)J6A6`uv>BBX5l^dF-7f+=5TVY-a)blCZmN_!;$zwd{`aV@ zQK$w6xxJrwhyihXYASl(-FE(uW5{+0&4F^s7vb0+yLO~~$n){oAfo`6N&J&k$z{F- z9m!KO*{yAzx1D6|x^m}J_v&NyoG9IFsNXji`B_R~ zkYRrdt7{Q`5ma%}7+B|AF#1mTy;OW>hDOk-$Q@ehOlOO^kuUUj?l0D5YK;3|=3%yR z64U|CAAls+C$G0yVGI>H-9JiGgOg^!x;tfDiW}69Q3gTj#{$7Cwt@p_X&<5Iva>=o z#d#z0L+H?hMTsSnpH?~-6lCv0c`=({=8+Gm<0ghl>r|pD{FhlcAYLxwR>ZHM;&-!a zD5`7WbEA3P(G`q;U+tpXxrL`%pJzJqOknNt{xDW3kymrbA#WP3-PRIv52IQR4EBV| zE$a{;z!{WR^Z@Szmb}|K71UG#OilJ(vdl8XDV?48rY&Kt1pDl1r|oJXUsR7bd53VJu+J}~cao66C- zos#WVb^eeTQUj1mpiuKmarMKOWcdANAvVI1?vb9tL)U42zXImzolb8mY-o_k!?T9t zQ_B^e9FbebdCsC6-J?%jT$4 Date: Fri, 22 Mar 2019 14:31:05 +0100 Subject: [PATCH 03/33] bump version back to develop --- DESCRIPTION | 2 +- NEWS.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 17b3fab..1aad0d2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: SmaRP Title: SmaRP: Smart Retirement Planning -Version: 1.1.1 +Version: 1.1.1-9000 Authors@R: c(person("Gabriel", "Foix", role = c("aut", "cre"), email = "gabriel.foix@mirai-solutions.com"), person("Francesca", "Vitalini", role = c("aut"), diff --git a/NEWS.md b/NEWS.md index b9ba1c1..683db1c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# SmaRP 1.1.1-9000 + # SmaRP 1.1.1 ### Fixes From 54a022aea22a20bc1df14dd051250315d3ed9eb6 Mon Sep 17 00:00:00 2001 From: Nicoletta Farabullini Date: Fri, 22 Mar 2019 16:40:01 +0100 Subject: [PATCH 04/33] edited plot referencing removed expressions such as "shown below" to avoid awkwardness in case code or images show above fixes #101 --- vignettes/smarp_server.Rmd | 12 ++++++------ vignettes/smarp_ui.Rmd | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/vignettes/smarp_server.Rmd b/vignettes/smarp_server.Rmd index 9127817..ea36c69 100644 --- a/vignettes/smarp_server.Rmd +++ b/vignettes/smarp_server.Rmd @@ -40,7 +40,7 @@ The server includes: reactive variables, Mirai Solutions colors definition, plot ## Reactive variables -All inputs from the ui are then used to perform calculations, draw plots and write statements. Because these values are different for each user, the app will have to be constantly updated, thus the need for reactive statements. A simple example of a reactive statement used in the server can be found below: +All inputs from the ui are then used to perform calculations, draw plots and write statements. Because these values are different for each user, the app will have to be constantly updated, thus the need for reactive statements. A simple example of a reactive statement is the one for the gender: ```{r, eval = FALSE} gender <- reactive({ @@ -68,11 +68,11 @@ All functions used in this script can be found in the R directory. ## Plots -The ui displays two plots, one in the form of a graph and the other of a bar, shown below: +The ui displays two plots, one in the form of a graph and the other of a bar. ![](figures/plots.png "Plots") -They are both rendered using the `renderGvis` function from the googleVis package, where all specifications are made. Plot 1 is shown below: +They are both rendered using the `renderGvis` function from the googleVis package, where all specifications are made. The code creating `out$plot1` shows the example for the line plot: ```{r, eval = FALSE} output$plot1 <- renderGvis({ @@ -96,7 +96,7 @@ where, TserieGraphData is the specific plot type xvar and yvar are the x and y axis -options include all of the aesthetically features including the Mirai blue, which is defined as a particular shade as following: +options include all of the aesthetically features including the Mirai blue, which is defined as a particular shade: ```{r} miraiColors <- "['#008cc3', '#FF9966', '#13991c']" @@ -104,7 +104,7 @@ miraiColors <- "['#008cc3', '#FF9966', '#13991c']" ## Statements and report name -The total retirement value text as well as the disclaimer are created using the shiny function renderText. Within the function, the paste command is used to combine set sentences with changing values as shown below: +The total retirement value text as well as the disclaimer are created using the shiny function renderText. Within the function, the paste command is used to combine set sentences with changing values: ```{r, eval = FALSE} reportname <- reactive( @@ -118,7 +118,7 @@ Sys.Date is the date the report was created ## Download button -The download button is rendered using the shiny downloadHandler function. Within this function, all of the specifics of the report are specified (i.e. which Rmd file to compile, the name of the file and the format) as shown below: +The download button is rendered using the shiny downloadHandler function. Within this function, all of the specifics of the report are specified (i.e. which Rmd file to compile, the name of the file and the format): ```{r, eval = FALSE} output$report <- downloadHandler( diff --git a/vignettes/smarp_ui.Rmd b/vignettes/smarp_ui.Rmd index 33ad1b1..939ac5c 100644 --- a/vignettes/smarp_ui.Rmd +++ b/vignettes/smarp_ui.Rmd @@ -45,7 +45,7 @@ The header is the first object starting from the top of the page and it includes ![](figures/SmaRP_logo.png "SmaRP_logo") -These three objects are placed inside a `fluidRow` and divided into two columns: one containing the logo and the blue bar and the other the title. The blue bar and the logo is dragged from the Mirai Solutions website in the form of a URL and the logo as a .png image. A sample of the code is shown below: +These three objects are placed inside a `fluidRow` and divided into two columns: one containing the logo and the blue bar and the other the title. The blue bar and the logo is dragged from the Mirai Solutions website in the form of a URL and the logo as a .png image: ```{r, eval = FALSE} fluidRow( @@ -73,7 +73,7 @@ The personal Info panel gathers the user's personal data, later used to perform ![](figures/SmaRP_personal_info.png "SmaRP_personal_info") -Each component is created using a specific shiny function, explained below: +Each component is created using a specific shiny function: * Personal Info: text object with `h4` dimensions * Birthday: `dateInput` object with date-month-year format. The user can either select a date form the calendar or manually type it in @@ -84,7 +84,7 @@ Each component is created using a specific shiny function, explained below: * Kids: `numericInput` object. The user can increase/decrease the number with the arrows or enter it manually; the default is zero * Church affiliation: optional `checkbox` object. -Even though most components are self explanatory, `bsTooltip`s were added to provide short explanations. They appear in the form of a black box when the user places the cursor on a specific object. A sample of the code is shown below: +Even though most components are self explanatory, `bsTooltip`s were added to provide short explanations. They appear in the form of a black box when the user places the cursor on a specific object: ```{r, eval = FALSE} fluidRow( @@ -124,7 +124,7 @@ The table reports many output values including: Calendar, DirectP2, ReturnP2, To GitHub and Mirai Solutions logos were imported using urls. -The disclaimer message was created using the `verbatimTextOutput` function as shown below: +The disclaimer message was created using the `verbatimTextOutput` function: ```{r, eval = FALSE} fluidRow( From 52fe8f7302dbd3a80cb837ac40776d06bdd0efbc Mon Sep 17 00:00:00 2001 From: Nicoletta Farabullini Date: Mon, 25 Mar 2019 15:51:43 +0100 Subject: [PATCH 05/33] re-phrased expressions with the word "below" if followed by a pplot of a screenshot --- vignettes/smarp_ui.Rmd | 2 +- vignettes/smarp_user_manual.Rmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vignettes/smarp_ui.Rmd b/vignettes/smarp_ui.Rmd index 939ac5c..ce0dc8d 100644 --- a/vignettes/smarp_ui.Rmd +++ b/vignettes/smarp_ui.Rmd @@ -69,7 +69,7 @@ style determines where objects should be located. ## Personal Info -The personal Info panel gathers the user's personal data, later used to perform calculations. A snippet of the panel's outline can be found below +The personal Info panel gathers the user's personal data, later used to perform calculations. Fields are aligned both vertically and horizontally as shown in the snippet. ![](figures/SmaRP_personal_info.png "SmaRP_personal_info") diff --git a/vignettes/smarp_user_manual.Rmd b/vignettes/smarp_user_manual.Rmd index b59178e..8153d3d 100644 --- a/vignettes/smarp_user_manual.Rmd +++ b/vignettes/smarp_user_manual.Rmd @@ -92,7 +92,7 @@ There are some important notes to consider about the tax benefits fund. **The evolution of the different funds is shown on the first plot.** Mouseovering the graph lines, date and amount are displayed on an informative box. -**The bar plot below shows the distribution among funds at retirement age.** +**The bar plot shows the distribution among funds at retirement age.** - In case that no voluntary contributions to the occupational fund or private fund are available, only the occupational fund will be displayed. From 50bc07ab24ed509e480cda41aa048a527402695f Mon Sep 17 00:00:00 2001 From: Riccardo Porreca Date: Wed, 27 Mar 2019 18:20:09 +0100 Subject: [PATCH 06/33] Expose launch.browser argument (closes #108). --- R/launch_application.R | 10 +++++----- man/launch_application.Rd | 10 +++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/R/launch_application.R b/R/launch_application.R index 60d2cbf..403e21f 100644 --- a/R/launch_application.R +++ b/R/launch_application.R @@ -1,11 +1,11 @@ #' @title launch_application -#' +#' #' @rdname launch_application #' #' @description Launch the SmaRP Shiny wep app. #' -#' @param ... Additional arguments passed on to [runApp()]. Note that -#' argument `launch.browser` is always passed as `TRUE`. +#' @inheritParams shiny::runApp +#' @param ... Additional arguments passed on to [runApp()]. #' #' @return Side-effecting function. Launches the SmaRP app. #' @@ -15,10 +15,10 @@ #' } #' @importFrom shiny runApp #' @export -launch_application <- function(...) { +launch_application <- function(launch.browser = interactive(), ...) { runApp( appDir = system.file("application", package = "SmaRP"), - launch.browser = TRUE, + launch.browser = launch.browser, ... ) } diff --git a/man/launch_application.Rd b/man/launch_application.Rd index 7789012..234621c 100644 --- a/man/launch_application.Rd +++ b/man/launch_application.Rd @@ -4,11 +4,15 @@ \alias{launch_application} \title{launch_application} \usage{ -launch_application(...) +launch_application(launch.browser = interactive(), ...) } \arguments{ -\item{...}{Additional arguments passed on to \code{\link[=runApp]{runApp()}}. Note that -argument \code{launch.browser} is always passed as \code{TRUE}.} +\item{launch.browser}{If true, the system's default web browser will be +launched automatically after the app is started. Defaults to true in +interactive sessions only. This value of this parameter can also be a +function to call with the application's URL.} + +\item{...}{Additional arguments passed on to \code{\link[=runApp]{runApp()}}.} } \value{ Side-effecting function. Launches the SmaRP app. From 86f05fffd8e3c5af22290a846afe6d5b7cba1328 Mon Sep 17 00:00:00 2001 From: Riccardo Porreca Date: Wed, 27 Mar 2019 18:25:44 +0100 Subject: [PATCH 07/33] NEWS.md updated for #108. --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 683db1c..2e08e38 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # SmaRP 1.1.1-9000 +* launch_application() exposes the launch.browser argument to shiny::runApp (#108). + # SmaRP 1.1.1 ### Fixes From ea48a3b7ea7d756c7860bd11857118aa5f0b5508 Mon Sep 17 00:00:00 2001 From: riccardoporreca Date: Tue, 16 Apr 2019 16:03:10 +0200 Subject: [PATCH 08/33] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d3616c4..cee76f3 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,9 @@ containers](https://www.docker.com/resources/what-container)) and can be accessed at https://mirai-solutions.ch/apps/smarp/. The (development version of) **SmaRP** can also be served locally by installing the package from GitHub + ``` r -devtools::install_github("miraisolutions/SmaRP", build_vignettes = TRUE) +devtools::install_github("miraisolutions/SmaRP", build_opts = "") ``` and running ``` r From d1e6e6b038a871988e14186128caaaff9b045fe3 Mon Sep 17 00:00:00 2001 From: riccardoporreca Date: Tue, 16 Apr 2019 16:11:52 +0200 Subject: [PATCH 09/33] Updated NEWS.md for #120 --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 2e08e38..4b880f1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ # SmaRP 1.1.1-9000 * launch_application() exposes the launch.browser argument to shiny::runApp (#108). +* Updated install_github() README instructions due to un-supported build_vignettes argument (#120). # SmaRP 1.1.1 From 32416e6f9c48db2469cb6086c38c1cde15022d6a Mon Sep 17 00:00:00 2001 From: Riccardo Porreca Date: Tue, 16 Apr 2019 16:25:38 +0200 Subject: [PATCH 10/33] Refine data configuration/cleanup infrastructure (fixes #119). * Remove the created `data` upon cleanup, important when data are created upon package installation to build vignettes before the actual build+install. * Build-ignore created data, preventing INSTALL warning about `data` already existing. Also rearranged and fixed un-escaped entries. * Updated tools/config.R with configure::use_configure() after remotes::install_github("kevinushey/configure", "a915e8996fa9bc47c07cbd39125ab97382fb478d"). --- .Rbuildignore | 13 +++++++------ tools/config.R | 39 ++++----------------------------------- tools/config/cleanup.R | 2 +- tools/config/configure.R | 3 --- 4 files changed, 12 insertions(+), 45 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 49c3089..9084026 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,9 +1,10 @@ -^Meta$ +^data$ ^doc$ +^man-roxygen$ +^Meta$ + ^.*\.Rproj$ ^\.Rproj\.user$ - -Dockerfile -cloudbuild.yaml -man-roxygen -inst/application/data/taxdata +^Dockerfile$ +^cloudbuild\.yaml$ +^inst/application/data/taxdata$ diff --git a/tools/config.R b/tools/config.R index 1dcb892..c3c62b8 100644 --- a/tools/config.R +++ b/tools/config.R @@ -177,18 +177,11 @@ configure_common <- function(type) { configure_platform <- function(type) { - sysname <- Sys.info()[["sysname"]] - switch( - sysname, - "Windows" = configure_platform_windows(type), - "Darwin" = configure_platform_darwin(type), - "Linux" = configure_platform_linux(type), - "SunOS" = configure_platform_solaris(type), - stop("unrecognized platform '", sysname, "'") - ) -} + sysname <- tolower(Sys.info()[["sysname"]]) -configure_platform_common <- function(subdirs, type) { + subdirs <- sysname + if (sysname != "windows") + subdirs <- c("unix", subdirs) dirs <- c("R", "src") for (dir in dirs) { @@ -209,26 +202,6 @@ configure_platform_common <- function(subdirs, type) { } } -configure_platform_windows <- function(type) { - subdirs <- c("windows", bitness("windows/win")) - configure_platform_common(subdirs, type) -} - -configure_platform_darwin <- function(type) { - subdirs <- c("unix", "darwin", bitness("darwin/darwin")) - configure_platform_common(subdirs, type) -} - -configure_platform_linux <- function(type) { - subdirs <- c("unix", "linux", bitness("linux/linux")) - configure_platform_common(subdirs, type) -} - -configure_platform_solaris <- function(type) { - subdirs <- c("unix", "sunos", bitness("sunos/sunos")) - configure_platform_common(subdirs, type) -} - #' Execute R CMD config #' #' Read information about how \R is configured as through `R CMD config`. @@ -578,10 +551,6 @@ parse_key_value <- function( named(as.list(vals), keys) } -bitness <- function(prefix = "") { - paste(prefix, .Machine$sizeof.pointer * 8, sep = "") -} - move_directory <- function(source, target) { # ensure we're trying to move a directory diff --git a/tools/config/cleanup.R b/tools/config/cleanup.R index 88c6584..5b6ba83 100644 --- a/tools/config/cleanup.R +++ b/tools/config/cleanup.R @@ -1,4 +1,4 @@ # Clean up files generated during configuration here. # Use 'remove_file()' to remove files generated during configuration. - +unlink("data", recursive = TRUE) diff --git a/tools/config/configure.R b/tools/config/configure.R index 28acd82..51fea27 100644 --- a/tools/config/configure.R +++ b/tools/config/configure.R @@ -5,7 +5,6 @@ # Tooltip and validation message lists containing texts # Stored as data. To load, run e.g. `load("data/VM.rda")` - # Info Box IB <- list( Birthdate = "Date of birth", @@ -49,5 +48,3 @@ VM <- list( dir.create("data") save(IB, file = "data/IB.rda") save(VM, file = "data/VM.rda") - -# source_file("MessageData.R") From fb4a9216888f015796b0b68ff66a9d70ecb462ea Mon Sep 17 00:00:00 2001 From: Riccardo Porreca Date: Tue, 16 Apr 2019 16:27:11 +0200 Subject: [PATCH 11/33] Update NEWS for #119. --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 2e08e38..a9debb8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ # SmaRP 1.1.1-9000 * launch_application() exposes the launch.browser argument to shiny::runApp (#108). +* Automatic cleanup of data created via configure (#119). # SmaRP 1.1.1 From 8ad37a96378214a56e844e190c5c287ca6ab5499 Mon Sep 17 00:00:00 2001 From: nfarabullini <41536517+nfarabullini@users.noreply.github.com> Date: Fri, 10 May 2019 17:27:45 +0200 Subject: [PATCH 12/33] feature/123-header-background (#124) Fixed background header centeredness. * Refined final look of background "node" locations. * Fixes #123. --- NEWS.md | 1 + inst/application/www/style.css | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 8c45f2d..b731cc2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ * launch_application() exposes the launch.browser argument to shiny::runApp (#108). * Updated install_github() README instructions due to un-supported build_vignettes argument (#120). * Automatic cleanup of data created via configure (#119). +* Background header does not re-center with increasing page width (#123). # SmaRP 1.1.1 diff --git a/inst/application/www/style.css b/inst/application/www/style.css index d0ecbb9..b2bbb7b 100644 --- a/inst/application/www/style.css +++ b/inst/application/www/style.css @@ -22,8 +22,8 @@ html { margin-bottom: 10px; background-color: #009edb; background-image: url("illu-header-data.png"); - background-repeat: repeat-x; - background-position: center center; + background-repeat: repeat; + background-position: 0 200px; background-size: auto 400px; } From faa9e6d171ad46fb198b4c04636c5bb5894448bf Mon Sep 17 00:00:00 2001 From: Nicoletta Farabullini Date: Tue, 14 May 2019 13:52:29 +0200 Subject: [PATCH 13/33] DESCRIPTION file includes URL and BugReports sections closes #125 --- DESCRIPTION | 3 +++ NEWS.md | 1 + 2 files changed, 4 insertions(+) diff --git a/DESCRIPTION b/DESCRIPTION index 1aad0d2..06deedd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,6 +14,9 @@ Authors@R: c(person("Gabriel", "Foix", role = c("aut", "cre"), Description: Shiny App to calculate total pension fund. Depends: R (>= 3.5.0) License: GPL-3 +URL: https://mirai-solutions.ch, + https://github.com/miraisolutions/SmaRP#readme +BugReports: https://github.com/miraisolutions/SmaRP/issues Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) diff --git a/NEWS.md b/NEWS.md index b731cc2..d4737f0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ * Updated install_github() README instructions due to un-supported build_vignettes argument (#120). * Automatic cleanup of data created via configure (#119). * Background header does not re-center with increasing page width (#123). +* DESCRIPTION file includes URL and BugReports sections (#125). # SmaRP 1.1.1 From 95f56d2f4d675c3fa00ed2e7266b63907b51d459 Mon Sep 17 00:00:00 2001 From: nfarabullini <41536517+nfarabullini@users.noreply.github.com> Date: Tue, 21 May 2019 10:13:00 +0200 Subject: [PATCH 14/33] Update vignettes/smarp_server.Rmd Co-Authored-By: fvitalini --- vignettes/smarp_server.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/smarp_server.Rmd b/vignettes/smarp_server.Rmd index ea36c69..397830b 100644 --- a/vignettes/smarp_server.Rmd +++ b/vignettes/smarp_server.Rmd @@ -68,7 +68,7 @@ All functions used in this script can be found in the R directory. ## Plots -The ui displays two plots, one in the form of a graph and the other of a bar. +The ui displays two plots, one in the form of a line plot and the other in the form of of a bar plot. ![](figures/plots.png "Plots") From 9ab358444cebd08beacce4445ef97072e1e05942 Mon Sep 17 00:00:00 2001 From: nfarabullini <41536517+nfarabullini@users.noreply.github.com> Date: Tue, 21 May 2019 10:13:18 +0200 Subject: [PATCH 15/33] Update vignettes/smarp_server.Rmd Co-Authored-By: fvitalini --- vignettes/smarp_server.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/smarp_server.Rmd b/vignettes/smarp_server.Rmd index 397830b..7c1365a 100644 --- a/vignettes/smarp_server.Rmd +++ b/vignettes/smarp_server.Rmd @@ -96,7 +96,7 @@ where, TserieGraphData is the specific plot type xvar and yvar are the x and y axis -options include all of the aesthetically features including the Mirai blue, which is defined as a particular shade: +options include all of the aesthetic features including the Mirai color palette, which is defined via as hex codes: ```{r} miraiColors <- "['#008cc3', '#FF9966', '#13991c']" From 6ae6988046a08db22844f39a7d3a5885eaa5943a Mon Sep 17 00:00:00 2001 From: nfarabullini <41536517+nfarabullini@users.noreply.github.com> Date: Tue, 21 May 2019 10:14:12 +0200 Subject: [PATCH 16/33] Update vignettes/smarp_ui.Rmd Co-Authored-By: fvitalini --- vignettes/smarp_ui.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/smarp_ui.Rmd b/vignettes/smarp_ui.Rmd index ce0dc8d..dcd3df6 100644 --- a/vignettes/smarp_ui.Rmd +++ b/vignettes/smarp_ui.Rmd @@ -84,7 +84,7 @@ Each component is created using a specific shiny function: * Kids: `numericInput` object. The user can increase/decrease the number with the arrows or enter it manually; the default is zero * Church affiliation: optional `checkbox` object. -Even though most components are self explanatory, `bsTooltip`s were added to provide short explanations. They appear in the form of a black box when the user places the cursor on a specific object: +Even though most components are self explanatory, `bsTooltip`s were added to provide short explanations. They appear in the form of a box when the user places the cursor on a specific object: ```{r, eval = FALSE} fluidRow( From 3101ee5e8a91120ac00f6a32858043fdcdbd2199 Mon Sep 17 00:00:00 2001 From: nfarabullini <41536517+nfarabullini@users.noreply.github.com> Date: Tue, 21 May 2019 10:14:59 +0200 Subject: [PATCH 17/33] Update vignettes/smarp_server.Rmd Co-Authored-By: fvitalini --- vignettes/smarp_server.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/smarp_server.Rmd b/vignettes/smarp_server.Rmd index 7c1365a..8a397e6 100644 --- a/vignettes/smarp_server.Rmd +++ b/vignettes/smarp_server.Rmd @@ -40,7 +40,7 @@ The server includes: reactive variables, Mirai Solutions colors definition, plot ## Reactive variables -All inputs from the ui are then used to perform calculations, draw plots and write statements. Because these values are different for each user, the app will have to be constantly updated, thus the need for reactive statements. A simple example of a reactive statement is the one for the gender: +All inputs from the ui are then used to perform calculations, draw plots and write statements. Because these values are different for each user, the app will have to be constantly updated, thus the need for reactive statements. A simple example of a reactive statement is the one for the gender, which can be found in the server: ```{r, eval = FALSE} gender <- reactive({ From 15c1137ebb340a7a408876e6d2f275061dec4b4b Mon Sep 17 00:00:00 2001 From: nfarabullini <41536517+nfarabullini@users.noreply.github.com> Date: Tue, 21 May 2019 10:16:55 +0200 Subject: [PATCH 18/33] Update vignettes/smarp_server.Rmd Co-Authored-By: fvitalini --- vignettes/smarp_server.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/smarp_server.Rmd b/vignettes/smarp_server.Rmd index 8a397e6..43d607f 100644 --- a/vignettes/smarp_server.Rmd +++ b/vignettes/smarp_server.Rmd @@ -72,7 +72,7 @@ The ui displays two plots, one in the form of a line plot and the other in the f ![](figures/plots.png "Plots") -They are both rendered using the `renderGvis` function from the googleVis package, where all specifications are made. The code creating `out$plot1` shows the example for the line plot: +They are both rendered using the `renderGvis` function from the googleVis package, where all specifications are made. The code to render `out$plot1` is an example to render a googleVis plot: ```{r, eval = FALSE} output$plot1 <- renderGvis({ From 5d327f483788fad80e0ad63404b2c50da2fed242 Mon Sep 17 00:00:00 2001 From: nfarabullini <41536517+nfarabullini@users.noreply.github.com> Date: Tue, 21 May 2019 10:18:09 +0200 Subject: [PATCH 19/33] Update vignettes/smarp_server.Rmd Co-Authored-By: fvitalini --- vignettes/smarp_server.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/smarp_server.Rmd b/vignettes/smarp_server.Rmd index 43d607f..0f3e7ec 100644 --- a/vignettes/smarp_server.Rmd +++ b/vignettes/smarp_server.Rmd @@ -104,7 +104,7 @@ miraiColors <- "['#008cc3', '#FF9966', '#13991c']" ## Statements and report name -The total retirement value text as well as the disclaimer are created using the shiny function renderText. Within the function, the paste command is used to combine set sentences with changing values: +The total retirement value text as well as the disclaimer are created using the shiny function renderText. Within the function, the paste command can be used to combine fixed sentences with changing values: ```{r, eval = FALSE} reportname <- reactive( From 4b6b273d914d7d4f14866fcb12537ee1c513b803 Mon Sep 17 00:00:00 2001 From: Nicoletta Farabullini Date: Tue, 21 May 2019 10:53:39 +0200 Subject: [PATCH 20/33] removed the word "pension" from: - Occupational pension fund - Private pensions fund - Retirement pension fund updated roxygen --- R/core.R | 8 ++++---- README.md | 4 ++-- inst/application/report.Rmd | 24 ++++++++++++------------ inst/application/ui.R | 4 ++-- man-roxygen/P2.R | 2 +- man-roxygen/P3.R | 4 ++-- man/buildContributionP2Path.Rd | 6 +++--- man/buildContributionP3path.Rd | 6 +++--- man/buildTaxBenefits.Rd | 6 +++--- man/calcBVGpurchase.Rd | 4 ++-- tools/config/configure.R | 16 ++++++++-------- vignettes/smarp_ui.Rmd | 2 +- vignettes/smarp_user_manual.Rmd | 28 ++++++++++++++-------------- 13 files changed, 57 insertions(+), 57 deletions(-) diff --git a/R/core.R b/R/core.R index bdf5fcd..ea9d4a8 100644 --- a/R/core.R +++ b/R/core.R @@ -108,12 +108,12 @@ getRetirementCalendar <- function(birthday, givenday = today("UTC"), RetirementA #' #' @rdname buildContributionP2Path #' -#' @description Gather all the required information to project the annual contributions to the occupational pension fund. +#' @description Gather all the required information to project the annual contributions to the occupational fund. #' #' @inheritParams buildt #' @template salary #' @template P2 -#' @param CurrentP2 Value of the current assets in the Occupational Pension Fund. +#' @param CurrentP2 Value of the current assets in the Occupational Fund. #' @param rate Interests rate on annual basis. Constant interest rates are assumed. #' #' @return All contributions to the Pillar II in annual basis. @@ -197,7 +197,7 @@ calcExpectedSalaryPath <- function(Salary, SalaryGrowthRate, ncp) { #' #' @rdname calcBVGpurchase #' -#' @description Calculate the path of purchases to the Pilar II (Occupational pension fund, BVG). +#' @description Calculate the path of purchases to the Pilar II (Occupational fund, BVG). #' #' @inheritParams calcExpectedSalaryPath #' @inheritParams buildContributionP2Path @@ -226,7 +226,7 @@ calcBVGpurchase <- function(TypePurchase, P2purchase, ncp) { #' @inheritParams buildt #' @inheritParams calcExpectedSalaryPath #' @template P3 -#' @param CurrentP3 Value of the current assets in the Private Pension Fund (Pillar 3). +#' @param CurrentP3 Value of the current assets in the Private Fund (Pillar 3). #' #' @return All contributions to the Pillar III in annual basis. #' @examples diff --git a/README.md b/README.md index cee76f3..a79d82c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ SmaRP::launch_application() ## Details and key features -The evolution of the total retirement fund over time is computed by projecting the value of the occupational pension fund (Pillar II), the private pension fund (Pillar III) and the tax relief, thus deriving their contributions at the desired retirement age. +The evolution of the total retirement fund over time is computed by projecting the value of the occupational fund (Pillar II), the private fund (Pillar III) and the tax relief, thus deriving their contributions at the desired retirement age. *Contributions to Pillar II* are calculated from the salary and any additional voluntary purchases. @@ -66,7 +66,7 @@ The evolution of the total retirement fund over time is computed by projecting t - Inflation is not taken into account, although it can be proxied using the salary growth rate input. - The retirement plan is valid for employees only, i.e. persons whose main income is a salary. Self-employed people do not belong to this category. - The publicly managed pay-as-you-go system (Pillar I) is not considered. -- All generated tax benefits are 100% reinvested as an additional fund, interpreting the same return as the private pension fund. +- All generated tax benefits are 100% reinvested as an additional fund, interpreting the same return as the private fund. - In case of married couples with double income, the combined amount of all variables should be entered and a 50% income distribution is assumed. diff --git a/inst/application/report.Rmd b/inst/application/report.Rmd index 1bafe5c..1f9b104 100644 --- a/inst/application/report.Rmd +++ b/inst/application/report.Rmd @@ -112,7 +112,7 @@ It is implemented as an [R Shiny](https://shiny.rstudio.com/) pension calculator SmaRP is based on assumptions and includes some simplifications. Thus, it is advisable to use the app to perform different "what-if" scenarios and assess their feasibility. Any outcome should consider some degree of uncertainty. -The main drivers of the retirement pension fund are: +The main drivers of the retirement fund are: - **Salary** - the higher the stipend, the higher the future pension. The salary growth rate can be used as a proxy of the inflation or a general economic growth. @@ -124,7 +124,7 @@ The main drivers of the retirement pension fund are: - **Time** - the sooner the employee will start investing, the higher the final return will be. -Note that SmaRP does not make any consideration about the usage of the retirement pension funds. +Note that SmaRP does not make any consideration about the usage of the retirement funds. The main outcome is displayed in the "Results" section with a more detailed drill down in Appendix 2; formulas used to obtain these results are explained in Appendix 1. In addition, a list of assumptiuons and limitations is provided in a separate section as well as a brief explantation of the Swiss retirement system. @@ -230,7 +230,7 @@ The results shown above are based on the following inputs set by the user on the SalaryGrowthRate <- params$SalaryGrowthRate * 100 ``` * The current salary is **`r printCurrency(params$Salary)` CHF**, with a growth rate of `r SalaryGrowthRate`%, which is assumed constant until retirement. -* The occupational pension fund (Pillar II) is of **`r printCurrency(params$CurrentP2)` CHF**. +* The occupational fund (Pillar II) is of **`r printCurrency(params$CurrentP2)` CHF**. ```{r msgP2, echo = FALSE} if(is.null(params$P2purchase) || params$P2purchase == 0){ msgP2 <- "No voluntary contribution to Pillar II is made." @@ -240,7 +240,7 @@ if(is.null(params$P2purchase) || params$P2purchase == 0){ ``` * `r msgP2` * Pillar II has an interest rate of `r params$rate*100`%. We ensure that the amount considered in the analysis is always higher than the minimum required by law. -* The private pension fund (Pillar III) is of `r printCurrency(params$CurrentP3)` CHF. +* The private fund (Pillar III) is of `r printCurrency(params$CurrentP3)` CHF. * The annual contribution to Pillar III is of `r printCurrency(params$P3purchase)` CHF, with an expected return of `r params$returnP3*100`%. ```{r maritallabel, echo = FALSE} if(params$rate_group == "A"){ @@ -273,9 +273,9 @@ SmaRP is valid for employees only, i.e. persons whose main income is a salary. S SmaRP takes into account only the occupational (Pillar II) and the private (Pillar III) pension funds. The state-run pay-as-you-earn system (Pillar I) is law and salary dependent only, meaning there is no active decision-making from the employee's side. Therefore, it is not explicitly considered. -When calculating contributions to the Occupational Pension Fund (Pillar II) any salary above minimum threshold is taken into account to generate the retirement benefits. +When calculating contributions to the Occupational Fund (Pillar II) any salary above minimum threshold is taken into account to generate the retirement benefits. -SmaRP considers the tax saving generated by the voluntary retirement contributions, assuming that all generated tax benefits are 100% reinvested as an additional fund. The return from these tax benefits is set to be the same as those of the private pension fund. +SmaRP considers the tax saving generated by the voluntary retirement contributions, assuming that all generated tax benefits are 100% reinvested as an additional fund. The return from these tax benefits is set to be the same as those of the private fund. In case of married couples with double-income, SmaRP assumes that all monetary amounts are split 50% and both members have the same age. For more information, please refer to Appendix 3. @@ -289,7 +289,7 @@ A proxy of the taxable income is used to calculate tax savings.[^3] The taxable * Any additional voluntary contributions. -[^1]: SmaRP does not make any consideration about the usage of the retirement pension funds. For the Occupational pension fund, the Swiss pension law allows retirees to take the full amount as a lump sum or receive their pension in the form of a life annuity, or a mix of both. In that case, the minimum conversion rate is 6.8% (since 2017) and can vary depending on the retirement age. The Private fund, however, gets always paid as a lump sum. +[^1]: SmaRP does not make any consideration about the usage of the retirement funds. For the Occupational fund, the Swiss pension law allows retirees to take the full amount as a lump sum or receive their pension in the form of a life annuity, or a mix of both. In that case, the minimum conversion rate is 6.8% (since 2017) and can vary depending on the retirement age. The Private fund, however, gets always paid as a lump sum. [^2]: Church taxes differ based on the type (Evangelische or Roeman-katolische Kirche) and canton of residence. SmaRP does not make such distinction and always assumes the highest of the values. Moreover, when the church-tax depends on the cantonal tax rate (instead of being a fixed factor), an approximation is made and treated as the maximum possible factor (relevant for cantons: VS, BS, BL). [^3]: Taxes on assets are not considered. [^4]: Although most of those parameters can vary a bit depending on the canton, we use the federal values as proxy. @@ -319,7 +319,7 @@ Pillar I is a state-run pay-as-you-earn system with minimum benefits[^5]. It aim Pillar II is a compulsory, tax-deductible company occupational pension insurance fund[^6]. Its goal is to maintain pre-retirement living standards. Voluntary additional buy-ins are regulated, but allow for benefits enhancements at retirement age while reducing the tax burden during the working career. The pensionable salary is defined as part of the AHV with a range between 7/8 and 3 times the AHV salary (between 24.675 and 84.600 as of 01-01-2018). The amount within this range is called the "Mandatory Component" and all employers are required by law to insure at least this compulsory share. However, they are free to offer coverage for the salary above the upper threshold, which the vast majority provides as this extra coverage has become a de facto "must have" to attract employees. -Pillar III is a voluntary contribution; it is a privately-run, tax-deductible insurance fund. The private pension fund is modeled as an asset of a given amount ("Current assets"), to which contributions can be added annually ("Annual contribution"). The annual expected return of this asset is given as an input and assumed constant until the retirement date. +Pillar III is a voluntary contribution; it is a privately-run, tax-deductible insurance fund. The private fund is modeled as an asset of a given amount ("Current assets"), to which contributions can be added annually ("Annual contribution"). The annual expected return of this asset is given as an input and assumed constant until the retirement date. Tax benefits are always a key factor towards a smart retirement project. SmaRP takes them into consideration and implements them as an additional fund. @@ -395,13 +395,13 @@ where ## Pillar III -The private pension fund ($PillarIII$) at year $t$ is calculated as: +The private fund ($PillarIII$) at year $t$ is calculated as: $$ PillarIII (t)= \sum_{t=t_0}^TVCon * e^{r(T - t)} $$ where -- $r$ is the interest rate applied to the private pension fund[^9], +- $r$ is the interest rate applied to the private fund[^9], - $t_0$ is today's date, - $T$ is the retirement age. @@ -508,7 +508,7 @@ pander(Road2Retirement_to_print_Summarized) ```{r Road2Retirement_to_print_Pillar2, echo = FALSE, eval = show_text, include = show_text} if (show_text){ moncols <- c("Direct Contribution", "Total Contribution", "Return", "Occupational Fund") - set.caption('Occupational Pension Fund - Pillar 2') + set.caption('Occupational Fund - Pillar 2') Road2Retirement_to_print_Pillar2 <- Road2Retirement_to_print %>% mutate(`Direct Contribution` = P2ContributionPath + P2purchase) %>% rename(`Total Contribution` = DirectP2) %>% @@ -522,7 +522,7 @@ if (show_text){ ```{r Road2Retirement_to_print_Pillar3, echo = FALSE, eval=show_text, include=show_text} moncols <- c("Direct Contribution", "Total Contribution", "Return", "Private Fund") -set.caption('Private Pension Fund - Pillar 3') +set.caption('Private Fund - Pillar 3') Road2Retirement_to_print_Pillar3 <- Road2Retirement_to_print %>% mutate(`Direct Contribution` = P3ContributionPath + P3purchase) %>% rename(`Total Contribution` = DirectP3) %>% diff --git a/inst/application/ui.R b/inst/application/ui.R index 3f01f51..8560234 100644 --- a/inst/application/ui.R +++ b/inst/application/ui.R @@ -179,7 +179,7 @@ fluidPage( # Pillar II ------- fluidRow( boxPlus( - title = "Occupational Pension Fund - Pillar II", + title = "Occupational Fund - Pillar II", status = "primary", collapsible = TRUE, collapsed = TRUE, @@ -252,7 +252,7 @@ fluidPage( # Pillar III ------- fluidRow( boxPlus( - title = "Private Pension Fund - Pillar III", + title = "Private Fund - Pillar III", status = "primary", collapsible = TRUE, collapsed = TRUE, diff --git a/man-roxygen/P2.R b/man-roxygen/P2.R index cd52c28..af20d1f 100644 --- a/man-roxygen/P2.R +++ b/man-roxygen/P2.R @@ -1,2 +1,2 @@ -#' @param P2purchase Annual voluntary contribution to the Occupational Pension Fund. +#' @param P2purchase Annual voluntary contribution to the Occupational Fund. #' @param TypePurchase AnnualP2 if the purchase on the pillar II gets repeated every year until retirement. diff --git a/man-roxygen/P3.R b/man-roxygen/P3.R index d6074a8..50eef8b 100644 --- a/man-roxygen/P3.R +++ b/man-roxygen/P3.R @@ -1,2 +1,2 @@ -#' @param P3purchase Annual voluntary contribution to the Private Pension Fund (Pillar 3). -#' @param returnP3 Annual expected return on the Private Pension Fund. +#' @param P3purchase Annual voluntary contribution to the Private Fund (Pillar 3). +#' @param returnP3 Annual expected return on the Private Fund. diff --git a/man/buildContributionP2Path.Rd b/man/buildContributionP2Path.Rd index f148343..443fc73 100644 --- a/man/buildContributionP2Path.Rd +++ b/man/buildContributionP2Path.Rd @@ -15,9 +15,9 @@ buildContributionP2Path(birthday, Salary, SalaryGrowthRate, CurrentP2, \item{SalaryGrowthRate}{Rate at which the salary increases/decreases.} -\item{CurrentP2}{Value of the current assets in the Occupational Pension Fund.} +\item{CurrentP2}{Value of the current assets in the Occupational Fund.} -\item{P2purchase}{Annual voluntary contribution to the Occupational Pension Fund.} +\item{P2purchase}{Annual voluntary contribution to the Occupational Fund.} \item{TypePurchase}{AnnualP2 if the purchase on the pillar II gets repeated every year until retirement.} @@ -31,7 +31,7 @@ buildContributionP2Path(birthday, Salary, SalaryGrowthRate, CurrentP2, All contributions to the Pillar II in annual basis. } \description{ -Gather all the required information to project the annual contributions to the occupational pension fund. +Gather all the required information to project the annual contributions to the occupational fund. } \examples{ \dontrun{ diff --git a/man/buildContributionP3path.Rd b/man/buildContributionP3path.Rd index 91c8dfe..2b117cd 100644 --- a/man/buildContributionP3path.Rd +++ b/man/buildContributionP3path.Rd @@ -10,11 +10,11 @@ buildContributionP3path(birthday, P3purchase, CurrentP3, returnP3, \arguments{ \item{birthday}{Date of birth ("YYYY-MM-DD").} -\item{P3purchase}{Annual voluntary contribution to the Private Pension Fund (Pillar 3).} +\item{P3purchase}{Annual voluntary contribution to the Private Fund (Pillar 3).} -\item{CurrentP3}{Value of the current assets in the Private Pension Fund (Pillar 3).} +\item{CurrentP3}{Value of the current assets in the Private Fund (Pillar 3).} -\item{returnP3}{Annual expected return on the Private Pension Fund.} +\item{returnP3}{Annual expected return on the Private Fund.} \item{givenday}{Date at which the age is computed ("YYYY-MM-DD").} diff --git a/man/buildTaxBenefits.Rd b/man/buildTaxBenefits.Rd index 5710dd0..d85605f 100644 --- a/man/buildTaxBenefits.Rd +++ b/man/buildTaxBenefits.Rd @@ -13,11 +13,11 @@ buildTaxBenefits(birthday, TypePurchase, P2purchase, P3purchase, returnP3, \item{TypePurchase}{AnnualP2 if the purchase on the pillar II gets repeated every year until retirement.} -\item{P2purchase}{Annual voluntary contribution to the Occupational Pension Fund.} +\item{P2purchase}{Annual voluntary contribution to the Occupational Fund.} -\item{P3purchase}{Annual voluntary contribution to the Private Pension Fund (Pillar 3).} +\item{P3purchase}{Annual voluntary contribution to the Private Fund (Pillar 3).} -\item{returnP3}{Annual expected return on the Private Pension Fund.} +\item{returnP3}{Annual expected return on the Private Fund.} \item{Salary}{Stipend.} diff --git a/man/calcBVGpurchase.Rd b/man/calcBVGpurchase.Rd index 5e8d69d..6528f59 100644 --- a/man/calcBVGpurchase.Rd +++ b/man/calcBVGpurchase.Rd @@ -9,7 +9,7 @@ calcBVGpurchase(TypePurchase, P2purchase, ncp) \arguments{ \item{TypePurchase}{AnnualP2 if the purchase on the pillar II gets repeated every year until retirement.} -\item{P2purchase}{Annual voluntary contribution to the Occupational Pension Fund.} +\item{P2purchase}{Annual voluntary contribution to the Occupational Fund.} \item{ncp}{Length contribution path to retirement.} } @@ -17,7 +17,7 @@ calcBVGpurchase(TypePurchase, P2purchase, ncp) BVG purchase. } \description{ -Calculate the path of purchases to the Pilar II (Occupational pension fund, BVG). +Calculate the path of purchases to the Pilar II (Occupational fund, BVG). } \examples{ \dontrun{ diff --git a/tools/config/configure.R b/tools/config/configure.R index 51fea27..ea92479 100644 --- a/tools/config/configure.R +++ b/tools/config/configure.R @@ -8,9 +8,9 @@ # Info Box IB <- list( Birthdate = "Date of birth", - CurrentP3 = "Current retirement assets in your Private Pension Fund", - CurrentP2 = "Current retirement assets in your Occupational Pension Fund", - P3purchase = "Annual contributions into your Private Pension Fund. Note that SmaRP assumes that the same contributions repeats every year until the retirement", + CurrentP3 = "Current retirement assets in your Private Fund", + CurrentP2 = "Current retirement assets in your Occupational Fund", + P3purchase = "Annual contributions into your Private Fund. Note that SmaRP assumes that the same contributions repeats every year until the retirement", P2purchase = "Voluntary purchases in annual basis", returnP3 = "Annual expected return. Note that SmaRP keeps the return constant", TaxRelief = "Maximum amount you can deduct from your taxable income via voluntary contributions to retirement funds", @@ -21,7 +21,7 @@ IB <- list( SalaryGrowthRate = "Annual expected salary growth rate. Note that this growth rate keeps constant during the full career", TypePurchase = "Single: one-off purchase; Annual: constant annual purchase", rate_group = "If Married with Double Income, please enter all inputs as aggregated values", - P2interestRate = "Interest Rate on the Occupational Pension Fund return. If not provided, the minimum by low is used", + P2interestRate = "Interest Rate on the Occupational Fund return. If not provided, the minimum by low is used", git = "Redirect to git repository", RetirementAge = "Enter desired retirement age", RetirementAgeOptional = "Possibility to enter desired retirement age manually", @@ -35,13 +35,13 @@ VM <- list( Birthdate2 = "You should be retired already", RetirementAge = "Provide the desired retirement age", need_not_zero_base = "Provide a non zero value for ", - CurrentP3_notZero = "Private Pension Fund", - CurrentP3_CurrentP2_Salary_Purchases_notZero = "either Salary, Private Pension Fund, Occupational Pension Fund or funds purchases", - returnP3_notzero = "Private Pension Fund return", + CurrentP3_notZero = "Private Fund", + CurrentP3_CurrentP2_Salary_Purchases_notZero = "either Salary, Private Fund, Occupational Fund or funds purchases", + returnP3_notzero = "Private Fund return", plzgemeinden = "Provide a valid postal code / municipality", rate_group = "Provide a valid civil status", Salary = "Provide a non-zero Income", - TypePurchase = "Provide a valid Occupational Pension Fund purchase type", + TypePurchase = "Provide a valid Occupational Fund purchase type", TaxRateSwiss = "Provide a valid Tax Rate" ) diff --git a/vignettes/smarp_ui.Rmd b/vignettes/smarp_ui.Rmd index 28baf59..9148caf 100644 --- a/vignettes/smarp_ui.Rmd +++ b/vignettes/smarp_ui.Rmd @@ -97,7 +97,7 @@ fluidRow( ## Pillar II and III -Below the personal info part lies the pillars section. Pillar II is intended for the case of an occupational pension fund and Pillar III for a private one. +Below the personal info part lies the pillars section. Pillar II is intended for the case of an occupational fund and Pillar III for a private one. ![](figures/SmaRP_Pillar_II.png "SamRP_Pillar_II") diff --git a/vignettes/smarp_user_manual.Rmd b/vignettes/smarp_user_manual.Rmd index da93826..3122a07 100644 --- a/vignettes/smarp_user_manual.Rmd +++ b/vignettes/smarp_user_manual.Rmd @@ -35,13 +35,13 @@ The following is a list describing components in the first panel. Unless otherwi - **Church Affiliation** only requires a yes or no answer. No specification regarding which type is requested. -## Occupational Pension Fund - Pillar II +## Occupational Fund - Pillar II -The second panel contains all fields related to the occupational pension fund. +The second panel contains all fields related to the occupational fund. -- **Current Annual Salary** is the base to calculate contributions to the Occupational Pension Fund and the tax relief generated with the non-mandatory contributions. It is inserted in gross terms (before tax) with the maximum value set at 100M CHF. +- **Current Annual Salary** is the base to calculate contributions to the Occupational Fund and the tax relief generated with the non-mandatory contributions. It is inserted in gross terms (before tax) with the maximum value set at 100M CHF. -- **Current BVG Assets** is the amount already invested in the Occupational pension fund and can be found on the annual report of the Pension Fund.[^1] +- **Current BVG Assets** is the amount already invested in the Occupational fund and can be found on the annual report of the Pension Fund.[^1] - **Expected Salary Growth Rate %** should be entered in percentage and is constant during the full working life. Note that since all values are in nominal terms, the salary growth rate can be used as a proxy of the inflation or a general economic growth. References regarding historical values can be found [here](https://tradingeconomics.com/switzerland/wage-growth). @@ -52,22 +52,22 @@ The second panel contains all fields related to the occupational pension fund. - **Purchase Type** refers to previous voluntary purchases and can be made as a single or a constant, multi-year, working-life long contribution. -## Private Pension Fund - Pillar III +## Private Fund - Pillar III -The third panel is the private pension fund. It is non-compulsory and only includes annual contributions. +The third panel is the private fund. It is non-compulsory and only includes annual contributions. -- **Current Assets** is the amount already invested in the private pension fund.[^3] +- **Current Assets** is the amount already invested in the private fund.[^3] - **Annual Contribution** to the private fund on an annual basis is assumed to be constant throughout the entire working life. -- **Expected Return %** is the average expected return from the private pension fund. It should be entered in percentage and is constant throughout the entire working life.[^4] +- **Expected Return %** is the average expected return from the private fund. It should be entered in percentage and is constant throughout the entire working life.[^4] ## Results The text box above the plots summarizes the total pension fund the user will get at the end of his working life.[^5] -The total pension fund can be divided in three components: Occupational pension fund, Private pension fund and tax benefits fund. +The total pension fund can be divided in three components: Occupational fund, Private fund and tax benefits fund. **The tax benefits fund** cannot be directly capitalized as the other two, but is generated indirectly through tax relieves coming from contributions to the other funds. @@ -79,7 +79,7 @@ There are some important notes to consider about the tax benefits fund. - SmaRP assumes that all tax benefits are reinvested and somehow saved until retirement. -- The average expected return is the same as the private pension fund. +- The average expected return is the same as the private fund. ### Plot tab @@ -119,7 +119,7 @@ Given that those assumptions are specific to a very distinct scenario, married u [^1]: SmaRP assumes that the current BVG assets did not generate any tax benefits in the past, meaning that all funds come from mandatory contributions. -[^2]: Voluntary contributions to the Occupational Pension Fund represent an ad-hoc "purchase" of pension benefits made by the retiree. These purchases are usually made to fill gaps in the working life or to cover up previous lower salaries after a wage raise. -[^3]: SmaRP assumes that current assets on the private pension funds did not generate any tax benefits in the past. -[^4]: SmaRP assumes that the average expected return is the same for private pension funds as for the tax return. -[^5]: SmaRP does not make any consideration about the usage of the retirement pension funds. For the Occupational pension fund, the Swiss pension law allows retirees to take the full amount as a lump sum, receive their pension in the form of a life annuity, or a mix of both. In the last case, the minimum conversion rate as of 2018 is 6.8% and can vary depending on the retirement age. The Private fund, however, is always paid as a lump sum. +[^2]: Voluntary contributions to the Occupational Fund represent an ad-hoc "purchase" of pension benefits made by the retiree. These purchases are usually made to fill gaps in the working life or to cover up previous lower salaries after a wage raise. +[^3]: SmaRP assumes that current assets on the private funds did not generate any tax benefits in the past. +[^4]: SmaRP assumes that the average expected return is the same for private funds as for the tax return. +[^5]: SmaRP does not make any consideration about the usage of the retirement funds. For the Occupational fund, the Swiss pension law allows retirees to take the full amount as a lump sum, receive their pension in the form of a life annuity, or a mix of both. In the last case, the minimum conversion rate as of 2018 is 6.8% and can vary depending on the retirement age. The Private fund, however, is always paid as a lump sum. From 2d3223f508fc978dd8721f90879336be5ccadaec Mon Sep 17 00:00:00 2001 From: nfarabullini <41536517+nfarabullini@users.noreply.github.com> Date: Tue, 21 May 2019 11:05:19 +0200 Subject: [PATCH 21/33] Update vignettes/smarp_server.Rmd Co-Authored-By: fvitalini --- vignettes/smarp_server.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/smarp_server.Rmd b/vignettes/smarp_server.Rmd index 0f3e7ec..abd3bca 100644 --- a/vignettes/smarp_server.Rmd +++ b/vignettes/smarp_server.Rmd @@ -118,7 +118,7 @@ Sys.Date is the date the report was created ## Download button -The download button is rendered using the shiny downloadHandler function. Within this function, all of the specifics of the report are specified (i.e. which Rmd file to compile, the name of the file and the format): +The download button is rendered using the shiny downloadHandler function. Within this function, all of the specifications of the report are listed (i.e. which Rmd file to compile, the name of the file and the format): ```{r, eval = FALSE} output$report <- downloadHandler( From 840faf38ee9eb7372dabf3c7770131887def75e9 Mon Sep 17 00:00:00 2001 From: Nicoletta Farabullini Date: Tue, 21 May 2019 11:09:02 +0200 Subject: [PATCH 22/33] NEWS.md file updated --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index d4737f0..8130576 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,7 @@ * Automatic cleanup of data created via configure (#119). * Background header does not re-center with increasing page width (#123). * DESCRIPTION file includes URL and BugReports sections (#125). +* Made a few syntax changes in vignettes (#101). # SmaRP 1.1.1 From 60acfb91e4eea4f750cc2c338b430a8110f69b59 Mon Sep 17 00:00:00 2001 From: Nicoletta Farabullini Date: Tue, 21 May 2019 11:28:14 +0200 Subject: [PATCH 23/33] changed Pillars nomenclature: - Pillar I - first or 1st Pillar - Pillar II - second or 2nd Pillar - Pillar III - third or 3rd Pillar --- R/core.R | 8 +++---- README.md | 16 ++++++------- inst/application/report.Rmd | 40 ++++++++++++++++----------------- inst/application/server.R | 4 ++-- inst/application/ui.R | 12 +++++----- man-roxygen/P2.R | 2 +- man/buildContributionP2Path.Rd | 4 ++-- man/buildContributionP3path.Rd | 4 ++-- man/buildTaxBenefits.Rd | 2 +- man/calcBVGpurchase.Rd | 4 ++-- vignettes/smarp_ui.Rmd | 12 +++++----- vignettes/smarp_user_manual.Rmd | 4 ++-- 12 files changed, 56 insertions(+), 56 deletions(-) diff --git a/R/core.R b/R/core.R index ea9d4a8..a009155 100644 --- a/R/core.R +++ b/R/core.R @@ -116,7 +116,7 @@ getRetirementCalendar <- function(birthday, givenday = today("UTC"), RetirementA #' @param CurrentP2 Value of the current assets in the Occupational Fund. #' @param rate Interests rate on annual basis. Constant interest rates are assumed. #' -#' @return All contributions to the Pillar II in annual basis. +#' @return All contributions to the 2nd Pillar on an annual basis. #' #' @examples #' \dontrun{ @@ -197,7 +197,7 @@ calcExpectedSalaryPath <- function(Salary, SalaryGrowthRate, ncp) { #' #' @rdname calcBVGpurchase #' -#' @description Calculate the path of purchases to the Pilar II (Occupational fund, BVG). +#' @description Calculate the path of purchases to the second Pillar (Occupational fund, BVG). #' #' @inheritParams calcExpectedSalaryPath #' @inheritParams buildContributionP2Path @@ -220,7 +220,7 @@ calcBVGpurchase <- function(TypePurchase, P2purchase, ncp) { #' #' @rdname buildContributionP3path #' -#' @description Build the contribution path for a standard pension fund, called Pillar III in Switzerland. +#' @description Build the contribution path for a standard pension fund, called 3rd Pillar in Switzerland. #' Based on 'calcAnnuityAcumPath()'. #' #' @inheritParams buildt @@ -228,7 +228,7 @@ calcBVGpurchase <- function(TypePurchase, P2purchase, ncp) { #' @template P3 #' @param CurrentP3 Value of the current assets in the Private Fund (Pillar 3). #' -#' @return All contributions to the Pillar III in annual basis. +#' @return All contributions to the 3rd Pillar on an annual basis. #' @examples #' \dontrun{ #' buildContributionP3path( diff --git a/README.md b/README.md index a79d82c..78245a8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ @@ -102,15 +102,15 @@ fluidRow( ``` -## Pillar II and III +## 2nd and 3rd Pillar -Below the personal info part lies the pillars section. Pillar II is intended for the case of an occupational fund and Pillar III for a private one. +Below the personal info part lies the pillars section. Second Pillar is intended for the case of an occupational fund and the third Pillar for a private one. -![](figures/SmaRP_Pillar_II.png "SamRP_Pillar_II") +![](figures/SmaRP_Pillar_II.png "SmaRP_Pillar_2") -![](figures/SmaRP_Pillar_III.png "SamRP_Pillar_III") +![](figures/SmaRP_Pillar_III.png "SmaRP_Pillar_3") -They both contain `numericInput`s inside `fluidRow`s and a `radioButtons` in the case of Pillar II. +They both contain `numericInput`s inside `fluidRow`s and a `radioButtons` in the case of the second Pillar. ## Plots and table diff --git a/vignettes/smarp_user_manual.Rmd b/vignettes/smarp_user_manual.Rmd index 5b1b46c..4d27a29 100644 --- a/vignettes/smarp_user_manual.Rmd +++ b/vignettes/smarp_user_manual.Rmd @@ -41,7 +41,7 @@ The following is a list describing components in the first panel. Unless otherwi - **Church Affiliation** only requires a yes or no answer. No specification regarding which type is requested. -## Occupational Fund - Pillar II +## Occupational Fund - 2nd Pillar The second panel contains all fields related to the occupational fund. @@ -58,7 +58,7 @@ The second panel contains all fields related to the occupational fund. - **Purchase Type** refers to previous voluntary purchases and can be made as a single or a constant, multi-year, working-life long contribution. -## Private Fund - Pillar III +## Private Fund - Third Pillar The third panel is the private fund. It is non-compulsory and only includes annual contributions. From cf3ede6e89b629f231cf24c61afffa7788deb104 Mon Sep 17 00:00:00 2001 From: Nicoletta Farabullini Date: Tue, 21 May 2019 11:35:01 +0200 Subject: [PATCH 24/33] changed from: - Pillar 2 -> 2nd Pillar - Pillar 3 -> 3rd Pillar updated roxygen --- R/core.R | 2 +- inst/application/report.Rmd | 4 ++-- man-roxygen/P3.R | 2 +- man/buildContributionP3path.Rd | 4 ++-- man/buildTaxBenefits.Rd | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/R/core.R b/R/core.R index a009155..8bdbd8b 100644 --- a/R/core.R +++ b/R/core.R @@ -226,7 +226,7 @@ calcBVGpurchase <- function(TypePurchase, P2purchase, ncp) { #' @inheritParams buildt #' @inheritParams calcExpectedSalaryPath #' @template P3 -#' @param CurrentP3 Value of the current assets in the Private Fund (Pillar 3). +#' @param CurrentP3 Value of the current assets in the Private Fund (3rd Pillar). #' #' @return All contributions to the 3rd Pillar on an annual basis. #' @examples diff --git a/inst/application/report.Rmd b/inst/application/report.Rmd index 935de49..2e29d55 100644 --- a/inst/application/report.Rmd +++ b/inst/application/report.Rmd @@ -508,7 +508,7 @@ pander(Road2Retirement_to_print_Summarized) ```{r Road2Retirement_to_print_Pillar2, echo = FALSE, eval = show_text, include = show_text} if (show_text){ moncols <- c("Direct Contribution", "Total Contribution", "Return", "Occupational Fund") - set.caption('Occupational Fund - Pillar 2') + set.caption('Occupational Fund - 2nd Pillar') Road2Retirement_to_print_Pillar2 <- Road2Retirement_to_print %>% mutate(`Direct Contribution` = P2ContributionPath + P2purchase) %>% rename(`Total Contribution` = DirectP2) %>% @@ -522,7 +522,7 @@ if (show_text){ ```{r Road2Retirement_to_print_Pillar3, echo = FALSE, eval=show_text, include=show_text} moncols <- c("Direct Contribution", "Total Contribution", "Return", "Private Fund") -set.caption('Private Fund - Pillar 3') +set.caption('Private Fund - 3rd Pillar') Road2Retirement_to_print_Pillar3 <- Road2Retirement_to_print %>% mutate(`Direct Contribution` = P3ContributionPath + P3purchase) %>% rename(`Total Contribution` = DirectP3) %>% diff --git a/man-roxygen/P3.R b/man-roxygen/P3.R index 50eef8b..5a9c670 100644 --- a/man-roxygen/P3.R +++ b/man-roxygen/P3.R @@ -1,2 +1,2 @@ -#' @param P3purchase Annual voluntary contribution to the Private Fund (Pillar 3). +#' @param P3purchase Annual voluntary contribution to the Private Fund (3rd Pillar). #' @param returnP3 Annual expected return on the Private Fund. diff --git a/man/buildContributionP3path.Rd b/man/buildContributionP3path.Rd index 2cf268e..370f9c0 100644 --- a/man/buildContributionP3path.Rd +++ b/man/buildContributionP3path.Rd @@ -10,9 +10,9 @@ buildContributionP3path(birthday, P3purchase, CurrentP3, returnP3, \arguments{ \item{birthday}{Date of birth ("YYYY-MM-DD").} -\item{P3purchase}{Annual voluntary contribution to the Private Fund (Pillar 3).} +\item{P3purchase}{Annual voluntary contribution to the Private Fund (3rd Pillar).} -\item{CurrentP3}{Value of the current assets in the Private Fund (Pillar 3).} +\item{CurrentP3}{Value of the current assets in the Private Fund (3rd Pillar).} \item{returnP3}{Annual expected return on the Private Fund.} diff --git a/man/buildTaxBenefits.Rd b/man/buildTaxBenefits.Rd index 2419141..e9bbcd2 100644 --- a/man/buildTaxBenefits.Rd +++ b/man/buildTaxBenefits.Rd @@ -15,7 +15,7 @@ buildTaxBenefits(birthday, TypePurchase, P2purchase, P3purchase, returnP3, \item{P2purchase}{Annual voluntary contribution to the Occupational Fund.} -\item{P3purchase}{Annual voluntary contribution to the Private Fund (Pillar 3).} +\item{P3purchase}{Annual voluntary contribution to the Private Fund (3rd Pillar).} \item{returnP3}{Annual expected return on the Private Fund.} From 0b175e1b89b21fb79c4b06414a9545354b25a35f Mon Sep 17 00:00:00 2001 From: Nicoletta Farabullini Date: Tue, 21 May 2019 11:35:56 +0200 Subject: [PATCH 25/33] updated NEWS.md --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 8130576..b278b8a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,6 +6,7 @@ * Background header does not re-center with increasing page width (#123). * DESCRIPTION file includes URL and BugReports sections (#125). * Made a few syntax changes in vignettes (#101). +* Chnaged Pillars nomenclature to be consistent with offical terminology (#103). # SmaRP 1.1.1 From 116ef26e78e3f0f50edd1aad51fe83c069f8d51e Mon Sep 17 00:00:00 2001 From: Nicoletta Farabullini Date: Tue, 21 May 2019 11:37:04 +0200 Subject: [PATCH 26/33] small adjustment for consistency --- R/core.R | 2 +- man/calcBVGpurchase.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/core.R b/R/core.R index 8bdbd8b..1fe2751 100644 --- a/R/core.R +++ b/R/core.R @@ -197,7 +197,7 @@ calcExpectedSalaryPath <- function(Salary, SalaryGrowthRate, ncp) { #' #' @rdname calcBVGpurchase #' -#' @description Calculate the path of purchases to the second Pillar (Occupational fund, BVG). +#' @description Calculate the path of purchases to the 2nd Pillar (Occupational fund, BVG). #' #' @inheritParams calcExpectedSalaryPath #' @inheritParams buildContributionP2Path diff --git a/man/calcBVGpurchase.Rd b/man/calcBVGpurchase.Rd index 0bc2c72..90a51f1 100644 --- a/man/calcBVGpurchase.Rd +++ b/man/calcBVGpurchase.Rd @@ -17,7 +17,7 @@ calcBVGpurchase(TypePurchase, P2purchase, ncp) BVG purchase. } \description{ -Calculate the path of purchases to the second Pillar (Occupational fund, BVG). +Calculate the path of purchases to the 2nd Pillar (Occupational fund, BVG). } \examples{ \dontrun{ From 9b6c9ab7844e5fa30a95eae12b8dc17a7c0d9240 Mon Sep 17 00:00:00 2001 From: Nicoletta Farabullini Date: Tue, 21 May 2019 11:40:11 +0200 Subject: [PATCH 27/33] grammar mistake correction --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index b278b8a..3c350d5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,7 +6,7 @@ * Background header does not re-center with increasing page width (#123). * DESCRIPTION file includes URL and BugReports sections (#125). * Made a few syntax changes in vignettes (#101). -* Chnaged Pillars nomenclature to be consistent with offical terminology (#103). +* Changed Pillars nomenclature to be consistent with official terminology (#103). # SmaRP 1.1.1 From 7f9155eb378f7dd1a49705ff8356680f39b6d945 Mon Sep 17 00:00:00 2001 From: Nicoletta Farabullini Date: Tue, 21 May 2019 11:42:50 +0200 Subject: [PATCH 28/33] grammar adjustment in report --- inst/application/report.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/application/report.Rmd b/inst/application/report.Rmd index 2e29d55..33d8ea8 100644 --- a/inst/application/report.Rmd +++ b/inst/application/report.Rmd @@ -319,7 +319,7 @@ First Pillar is a state-run pay-as-you-earn system with minimum benefits[^5]. It Second Pillar is a compulsory, tax-deductible company occupational pension insurance fund[^6]. Its goal is to maintain pre-retirement living standards. Voluntary additional buy-ins are regulated, but allow for benefits enhancements at retirement age while reducing the tax burden during the working career. The pensionable salary is defined as part of the AHV with a range between 7/8 and 3 times the AHV salary (between 24.675 and 84.600 as of 01-01-2018). The amount within this range is called the "Mandatory Component" and all employers are required by law to insure at least this compulsory share. However, they are free to offer coverage for the salary above the upper threshold, which the vast majority provides as this extra coverage has become a de facto "must have" to attract employees. -The third Pillar is a voluntary contribution; it is a privately-run, tax-deductible insurance fund. The private fund is modeled as an asset of a given amount ("Current assets"), to which contributions can be added annually ("Annual contribution"). The annual expected return of this asset is given as an input and assumed constant until the retirement date. +Third Pillar is a voluntary contribution; it is a privately-run, tax-deductible insurance fund. The private fund is modeled as an asset of a given amount ("Current assets"), to which contributions can be added annually ("Annual contribution"). The annual expected return of this asset is given as an input and assumed constant until the retirement date. Tax benefits are always a key factor towards a smart retirement project. SmaRP takes them into consideration and implements them as an additional fund. From a9bd40494e9509897a11de10c98eef845d273522 Mon Sep 17 00:00:00 2001 From: nfarabullini <41536517+nfarabullini@users.noreply.github.com> Date: Tue, 11 Jun 2019 14:28:50 +0200 Subject: [PATCH 29/33] Feature/129 initialize values (#132) Review initialization / max / min values. * Values stored in global. * Annual Contribution initialized at 5000. * numericInput re-set to 0 or minimum value if lower number is inserted. * Unused maximum values erased. * Closes #3. --- NAMESPACE | 1 + NEWS.md | 3 +++ R/core.R | 20 +++++++++++++++++ inst/application/global.R | 27 ++++++++++++++++++++--- inst/application/server.R | 42 ++++++++++++++++++++--------------- inst/application/ui.R | 46 ++++++++++++++++++--------------------- man/update_neg.Rd | 19 ++++++++++++++++ 7 files changed, 113 insertions(+), 45 deletions(-) create mode 100644 man/update_neg.Rd diff --git a/NAMESPACE b/NAMESPACE index 2d43edf..f7fc66e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -22,6 +22,7 @@ export(makeTable) export(need_not_zero) export(printCurrency) export(returnPLZKanton) +export(update_neg) export(withModalSpinner) import(dplyr) importFrom(dplyr,'%>%') diff --git a/NEWS.md b/NEWS.md index 3c350d5..b4f9fbb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,6 +7,9 @@ * DESCRIPTION file includes URL and BugReports sections (#125). * Made a few syntax changes in vignettes (#101). * Changed Pillars nomenclature to be consistent with official terminology (#103). +* Annual Contribution initialized at 5000, numericInput re-set to 0 or minimum +value if lower number is inserted, unused maximum values erased (#129). + # SmaRP 1.1.1 diff --git a/R/core.R b/R/core.R index 1fe2751..ab6be6f 100644 --- a/R/core.R +++ b/R/core.R @@ -434,6 +434,26 @@ need_not_zero <- function(input, inputname) { } } +#' @title update_neg +#' +#' @rdname update_neg +#' +#' @description Automatically updates numericInput to zero if input is negative. +#' +#' @param inputId Field name. +#' @param session Current session. +#' +#' @return Zero value. +#' @export +update_neg <- function(inputId, session) { + val <- 0 + input <- session$input[[inputId]] + # name <- sub('.', '', unlist(strsplit(name, "input")))[2] + if (!is.na(input) && input < val) { + updateNumericInput(session, toString(inputId), value = val) + } +} + # Format Percentage ---- diff --git a/inst/application/global.R b/inst/application/global.R index ed9cbc7..9a4d68c 100644 --- a/inst/application/global.R +++ b/inst/application/global.R @@ -2,9 +2,6 @@ library(SmaRP) `%>%` <- magrittr::`%>%` # Global variables -# Gender-based retirement age -MRetirementAge <- 65 -FRetirementAge <- 64 # https://www.admin.ch/opc/de/classified-compilation/19820152/index.html#a8 MinBVG <- 24885 # Min Koordinierter Lohn (MinBVG = MaxAHV * (7 / 8)) @@ -105,3 +102,27 @@ BerufsauslagenMax <- 4000 BerufsauslagenMin <- 2000 NBU <- 0.0084 maxNBU <- 1065 + +# List of initial, max and min values +value <- list ( + birthday = "1980-12-30", + gender = "M", + min_retirement = 55, + max_retirement = 70, + retirement_female = 64, + retirement_male = 65, + plz = with(PLZGemeinden, PLZGDENAME[match(8001, PLZ)]), + rate = "A", + min_children = 0, + max_children = 9, + church = "A", + salary = 100000, + max_salary = 1e+08, + growth_rate = 0.5, + p2 = 100000, + min_p2_interest = 100 * BVGMindestzinssatz, + p2_voluntary = 0, + p3 = 50000, + p3_annual = 5000, + p3_return = 100 * BVGMindestzinssatz +) diff --git a/inst/application/server.R b/inst/application/server.R index 8b36183..453a8c7 100644 --- a/inst/application/server.R +++ b/inst/application/server.R @@ -26,29 +26,29 @@ function(input, output, session) { # Retirement Age RetirementAge <- reactive({ + + val <- max(min(isnotAvailableReturnZero(input$RetirementAge), value$max_retirement), value$min_retirement) + if (!is.na(input$RetirementAge) && input$RetirementAge != val) { + updateNumericInput(session, "RetirementAge", value = val) + } + if (input$provideRetirementAge) { validate(need(input$RetirementAge, VM$RetirementAge)) - min(70, input$RetirementAge) + min(value$max_retirement, input$RetirementAge) } else { if (gender() == "M") { - MRetirementAge + value$retirement_male } else { - FRetirementAge + value$retirement_female } } }) %>% debounce(millis = 100) - observeEvent(input$RetirementAge, ignoreNULL = TRUE, { - if (!is.na(input$RetirementAge) && input$RetirementAge > 70) { - updateNumericInput(session, "RetirementAge", value = 70) - } - }) - observeEvent(input$gender, { if (gender() == "F") { - updateNumericInput(session, "RetirementAge", value = 64) + updateNumericInput(session, "RetirementAge", value = value$retirement_female) } else { - updateNumericInput(session, "RetirementAge", value = 65) + updateNumericInput(session, "RetirementAge", value = value$retirement_male) } }) @@ -59,6 +59,8 @@ function(input, output, session) { }) CurrentP3 <- reactive({ + update_neg("CurrentP3", session) + if (P3purchase() == 0 & Salary() == 0 & CurrentP2() == 0 & P2purchase() == 0) { validate( @@ -74,6 +76,7 @@ function(input, output, session) { }) P3purchase <- reactive({ + update_neg("P3purchase", session) isnotAvailableReturnZero(input$P3purchase) }) @@ -82,6 +85,8 @@ function(input, output, session) { }) returnP3 <- reactive({ + update_neg("returnP3", session) + if (CurrentP3() == 0 & P3purchase() == 0 & Salary() == 0 & CurrentP2() == 0 & P2purchase() == 0) { @@ -121,7 +126,7 @@ function(input, output, session) { # Number of kids (max = 9) NChildren <- reactive({ - val <- max(min(isnotAvailableReturnZero(input$NChildren), 9), 0) + val <- max(min(isnotAvailableReturnZero(input$NChildren), value$max_children), 0) if (!is.na(input$NChildren) && input$NChildren != val) { updateNumericInput(session, "NChildren", value = val) } @@ -145,7 +150,7 @@ function(input, output, session) { # Salary Salary <- reactive({ - val <- max(min(isnotAvailableReturnZero(input$Salary), 1e+08), 0) + val <- max(min(isnotAvailableReturnZero(input$Salary), value$max_salary), 0) if (!is.na(input$Salary) && input$Salary != val) { updateNumericInput(session, "Salary", value = val) } @@ -153,23 +158,26 @@ function(input, output, session) { }) %>% debounce(millis = 100) SalaryGrowthRate <- reactive({ + update_neg("SalaryGrowthRate", session) isnotAvailableReturnZero(input$SalaryGrowthRate / 100) }) # 2nd Pillar CurrentP2 <- reactive({ + update_neg("CurrentP2", session) isnotAvailableReturnZero(input$CurrentP2) }) P2interestRate <- reactive({ - if (isnotAvailable(input$P2interestRate)) { - BVGMindestzinssatz - } else { - input$P2interestRate / 100 + val <- value$min_p2_interest + if (!is.na(input$P2interestRate) && input$P2interestRate < val) { + updateNumericInput(session, "P2interestRate", value = val) } + isnotAvailableReturnZero(input$P2interestRate / 100) }) P2purchase <- reactive({ + update_neg("P2purchase", session) isnotAvailableReturnZero(input$P2purchase) }) diff --git a/inst/application/ui.R b/inst/application/ui.R index c51ec6a..0fc8c37 100644 --- a/inst/application/ui.R +++ b/inst/application/ui.R @@ -75,7 +75,7 @@ fluidPage( 6, dateInput("Birthdate", label = "Birthdate", - value = "1980-12-30", + value = value$birthday, format = "dd-mm-yyyy" ) %>% bs_embed_tooltip(title = IB$Birthdate, placement = "right") @@ -86,7 +86,7 @@ fluidPage( label = "Gender Affiliation", inline = TRUE, choices = list("Male" = "M", "Female" = "F"), - selected = "M" + selected = value$gender ) ) ), @@ -110,11 +110,10 @@ fluidPage( numericInput( "RetirementAge", label = NULL, # "Desired Retirement Age", - value = 64, + value = value$max_retirement, step = 1, - min = 55, - max = 70 # note this doesn't prevent or warn users entering - # larger numbers manually (see e.g. https://github.com/rstudio/shiny/issues/1022#issuecomment-282305308) + min = value$min_retirement, + max = value$max_retirement ) %>% bs_embed_tooltip(title = IB$RetirementAge, placement = "right") ) @@ -128,7 +127,7 @@ fluidPage( selectInput("plzgemeinden", label = h5("Postal Code / Municipality"), choices = PLZGemeinden$PLZGDENAME, - selected = with(PLZGemeinden, PLZGDENAME[match(8001, PLZ)]) + selected = value$plz ) ) ), @@ -142,16 +141,16 @@ fluidPage( bs_embed_tooltip(title = IB$rate_group, placement = "right"), inline = TRUE, choices = Rate_group.list, - selected = "A" + selected = value$rate ) ), column( 6, numericInput("NChildren", label = "# Children", - value = 0, + value = value$min_children, min = 0, - max = 9 + max = value$max_children ) %>% bs_embed_tooltip(title = IB$NChildren, placement = "right") ) @@ -165,7 +164,7 @@ fluidPage( label = "Church Affiliation", inline = TRUE, choices = church_tax.list, - selected = "A" + selected = value$church ) ) ), @@ -192,17 +191,16 @@ fluidPage( 6, numericInput("Salary", label = "Current Annual Salary", - value = 100000, + value = value$salary, step = 1000, min = 0 ) %>% bs_embed_tooltip(title = IB$Salary, placement = "right"), numericInput("SalaryGrowthRate", label = "Expected Salary Growth Rate %", - value = 0.5, + value = value$growth_rate, step = 0.1, - min = 0, - max = 100 + min = 0 ) %>% bs_embed_tooltip(title = IB$SalaryGrowthRate, placement = "right") ), @@ -210,17 +208,16 @@ fluidPage( 6, numericInput("CurrentP2", label = "Current BVG Assets", - value = 100000, + value = value$p2, step = 1000, min = 0 ) %>% bs_embed_tooltip(title = IB$CurrentP2, placement = "right"), numericInput("P2interestRate", label = "Interest Rate % (optional)", - value = 100 * BVGMindestzinssatz, + value = value$min_p2_interest, step = 1, - min = 100 * BVGMindestzinssatz, - max = 100 + min = value$min_p2_interest ) %>% bs_embed_tooltip(title = IB$P2interestRate, placement = "right") ) @@ -230,7 +227,7 @@ fluidPage( 6, numericInput("P2purchase", label = "Voluntary Purchases", - value = 0, + value = value$p2_voluntary, step = 500, min = 0 ) %>% @@ -265,7 +262,7 @@ fluidPage( 12, numericInput("CurrentP3", label = "Current Assets", - value = 50000, + value = value$p3, step = 1000, min = 0 ) %>% @@ -277,17 +274,16 @@ fluidPage( 12, numericInput("P3purchase", label = "Annual Contribution", - value = 0, + value = value$p3_annual, step = 500, min = 0 ) %>% bs_embed_tooltip(title = IB$P3purchase, placement = "right"), numericInput("returnP3", label = "Expected Return %", - value = BVGMindestzinssatz * 100, + value = value$p3_return, step = 0.1, - min = 0, - max = 100 + min = 0 ) %>% bs_embed_tooltip(title = IB$returnP3, placement = "right") ) diff --git a/man/update_neg.Rd b/man/update_neg.Rd new file mode 100644 index 0000000..deabeba --- /dev/null +++ b/man/update_neg.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/core.R +\name{update_neg} +\alias{update_neg} +\title{update_neg} +\usage{ +update_neg(inputId, session) +} +\arguments{ +\item{inputId}{Field name.} + +\item{session}{Current session.} +} +\value{ +Zero value. +} +\description{ +Automatically updates numericInput to zero if input is negative. +} From eee5f6c397b9cf747a76cb4a8a86383d4b050b62 Mon Sep 17 00:00:00 2001 From: Riccardo Porreca Date: Tue, 11 Jun 2019 15:27:17 +0200 Subject: [PATCH 30/33] Minor cleanup. --- R/core.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/R/core.R b/R/core.R index ab6be6f..1e0950b 100644 --- a/R/core.R +++ b/R/core.R @@ -448,9 +448,8 @@ need_not_zero <- function(input, inputname) { update_neg <- function(inputId, session) { val <- 0 input <- session$input[[inputId]] - # name <- sub('.', '', unlist(strsplit(name, "input")))[2] if (!is.na(input) && input < val) { - updateNumericInput(session, toString(inputId), value = val) + shiny::updateNumericInput(session, toString(inputId), value = val) } } From ccb7c4c8ff0ca4c8eff6227d873cb0ce636b328f Mon Sep 17 00:00:00 2001 From: nfarabullini <41536517+nfarabullini@users.noreply.github.com> Date: Tue, 11 Jun 2019 15:34:57 +0200 Subject: [PATCH 31/33] Added missing page title (#133) fixes #118 --- NEWS.md | 1 + inst/application/ui.R | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index b4f9fbb..d6a5b5a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,7 @@ * Changed Pillars nomenclature to be consistent with official terminology (#103). * Annual Contribution initialized at 5000, numericInput re-set to 0 or minimum value if lower number is inserted, unused maximum values erased (#129). +* Fixed missing page title (#118). # SmaRP 1.1.1 diff --git a/inst/application/ui.R b/inst/application/ui.R index 0fc8c37..31ad80d 100644 --- a/inst/application/ui.R +++ b/inst/application/ui.R @@ -10,7 +10,7 @@ boxPlus <- shinydashboardPlus::boxPlus # fluidPage UI fluidPage( - + title = "SmaRP: Smart Retirement Planning", tags$head( tags$script( type = "text/javascript", From 68636d6d495a2b3f66d1995045656c76c3555bfc Mon Sep 17 00:00:00 2001 From: nfarabullini <41536517+nfarabullini@users.noreply.github.com> Date: Tue, 11 Jun 2019 17:26:33 +0200 Subject: [PATCH 32/33] Pillars renaming (#134) Completed alignments of funds naming. * As in #103. * Minor re-phrasing in the report. --- R/TaxBenefit.R | 6 +++--- inst/application/report.Rmd | 28 +++++++++++++--------------- inst/application/server.R | 14 +++++++------- man/buildTaxBenefits.Rd | 2 +- man/calcTaxBenefitSwiss.Rd | 4 ++-- vignettes/smarp_user_manual.Rmd | 8 ++++---- 6 files changed, 30 insertions(+), 32 deletions(-) diff --git a/R/TaxBenefit.R b/R/TaxBenefit.R index 63ccdd2..c359a75 100644 --- a/R/TaxBenefit.R +++ b/R/TaxBenefit.R @@ -178,7 +178,7 @@ lookupTaxAmount <- function(Income, Tabelle, CivilStatus) { #' #' @import dplyr #' -#' @return data.frame tax benefit path. +#' @return data.frame tax benefits path. #' @examples #' \dontrun{buildTaxBenefits( #' birthday, @@ -236,7 +236,7 @@ buildTaxBenefits <- function(birthday, #' #' @rdname calcTaxBenefitSwiss #' -#' @description Calculates the tax benefit as a difference of the taxes paid with and without retirement contributions. +#' @description Calculates the tax benefits as a difference of the taxes paid with and without retirement contributions. #' Calls 'getTaxAmount()', therefore, it assumes objects in the global environment. #' @seealso [getTaxAmount()] #' @seealso swisstax @@ -245,7 +245,7 @@ buildTaxBenefits <- function(birthday, #' @param TaxableIncome Vector of annual taxable income until retirement. #' @inheritParams getTaxAmount #' -#' @return Single tax benefit (tax relief) of one contribution. +#' @return Single tax benefits (tax relief) of one contribution. #' @examples #' \dontrun{ #' calcTaxBenefitSwiss(ExpectedSalaryPath = seq(90000, 100000, 1000), diff --git a/inst/application/report.Rmd b/inst/application/report.Rmd index 33d8ea8..10f4369 100644 --- a/inst/application/report.Rmd +++ b/inst/application/report.Rmd @@ -108,7 +108,7 @@ Smart Retirement Planning (**SmaRP**) is a [Mirai Solutions](https://mirai-solut It is implemented as an [R Shiny](https://shiny.rstudio.com/) pension calculator web app, in the form of an R package. The source code is available on [GitHub](https://github.com/miraisolutions/SmaRP.git) and the app itself online at http://mirai-solutions.ch/apps/smarp/. -**SmaRP** is based on the [three pillars pension system](https://en.wikipedia.org/wiki/Pension_system_in_Switzerland) and reflects the complexity of its legal framework. The bulk of the retirement income are the second and third pillar, which employees can actively manage and make decisions impacting their total pension fund at retirement. The first pillar is not considered as it is a pay-as-you-go universal system whose benefits depend on the income earned during the working life and the number of years contributed. In addition, since non-mandatory contributions are tax favored, SmaRP incorporates an additional fund -the Tax benefits fund- to outline the effects of those tax reliefs on the long run. +**SmaRP** is based on the [three pillars pension system](https://en.wikipedia.org/wiki/Pension_system_in_Switzerland) and reflects the complexity of its legal framework. The bulk of the retirement income are the second and third pillar, which employees can actively manage and make decisions impacting their total pension fund at retirement. The first pillar is not considered as it is a pay-as-you-go universal system whose benefits depend on the income earned during the working life and the number of years contributed. In addition, since non-mandatory contributions are tax favored, SmaRP incorporates an additional fund -the Tax benefits- to outline the effects of those tax reliefs on the long run. SmaRP is based on assumptions and includes some simplifications. Thus, it is advisable to use the app to perform different "what-if" scenarios and assess their feasibility. Any outcome should consider some degree of uncertainty. @@ -126,7 +126,7 @@ The main drivers of the retirement fund are: Note that SmaRP does not make any consideration about the usage of the retirement funds. -The main outcome is displayed in the "Results" section with a more detailed drill down in Appendix 2; formulas used to obtain these results are explained in Appendix 1. In addition, a list of assumptiuons and limitations is provided in a separate section as well as a brief explantation of the Swiss retirement system. +The main outcome is displayed in the "Results" section with a more detailed drill down in Appendix 2; formulas used to obtain these results are explained in Appendix 1. In addition, a list of assumptions and limitations is provided in a separate section as well as a brief explanation of the Swiss retirement system.
\newpage @@ -149,8 +149,6 @@ Based on the information inserted in the three pillars, the total retirement fun The two plots below represent the time evolution of the different funds and their contribution to the total retirement fund at retirement, respectively. - - ```{r timeSeriesPlot, echo = FALSE} tserieGraphData.columns <- setdiff(names(params$TserieGraphData), "Calendar") @@ -162,7 +160,7 @@ tserieGraphData.long$variable <- factor(tserieGraphData.long$variable, decreasing = TRUE)) ggplot(tserieGraphData.long, aes(x = Calendar, y = value, fill = variable)) + - scale_fill_manual(NULL, values = c("Occupational Fund" = "#008cc3", "Private Fund" = "#FF9966", "Tax Benefits" = "#13991c")) + + scale_fill_manual(NULL, values = c("2nd Pillar" = "#008cc3", "3rd Pillar" = "#FF9966", "Tax Benefits" = "#13991c")) + scale_y_continuous(labels = scales::comma) + labs(x = "Year", y = "Return [CHF]") + geom_area(alpha = 0.6) + @@ -196,7 +194,7 @@ ggplot(data = barGraphData.long, aes(x = contribution, y = value, fill = variabl scale_x_discrete(breaks = NULL) + scale_y_continuous(labels = scales::percent) + coord_flip() + - scale_fill_manual(NULL, values = c("Occupational Fund" = "#008cc3", "Private Fund" = "#FF9966", "Tax Benefits" = "#13991c")) + + scale_fill_manual(NULL, values = c("2nd Pillar" = "#008cc3", "3rd Pillar" = "#FF9966", "Tax Benefits" = "#13991c")) + labs(x = NULL, y = "% Contribution of each fund at retirement") + theme( axis.text = element_text(size = 10), @@ -211,7 +209,7 @@ ggplot(data = barGraphData.long, aes(x = contribution, y = value, fill = variabl
-The graphs above display the amounts at the end of each year for the second, third Pillars and Tax Benefit fund. The corresponding formulas are in Appendix 1 of this document and a more detailed break down of the amounts can be found in Appendix 2. A comprehensive set of values calculated can de downloaded as well from the Table tab. +Corresponding formulas are in Appendix 1 of this document and a more detailed break down of the amounts can be found in Appendix 2. A comprehensive set of values calculated can de downloaded as well from the Table tab.
@@ -271,7 +269,7 @@ if (params$churchtax == "N"){ SmaRP is valid for employees only, i.e. persons whose main income is a salary. Self-employed people do not belong to this category. -SmaRP takes into account only the occupational (2nd Pillar) and the private (3rd Pillar) pension funds. The state-run pay-as-you-earn system (1st Pillar) is law and salary dependent only, meaning there is no active decision-making from the employee's side. Therefore, it is not explicitly considered. +SmaRP takes into account only the occupational (2nd Pillar) and the private (3rd Pillar) funds. The state-run pay-as-you-earn system (1st Pillar) is law and salary dependent only, meaning there is no active decision-making from the employee's side. Therefore, it is not explicitly considered. When calculating contributions to the Occupational Fund (2nd Pillar) any salary above minimum threshold is taken into account to generate the retirement benefits. @@ -388,16 +386,16 @@ where $$ r = 1\% $$ -$$ Pillar 2 = \sum_{t=t_0}^T(MCon + VCon) * \exp^{r*(T - t)} $$ +$$ P_2 = \sum_{t=t_0}^T(MCon + VCon) * \exp^{r*(T - t)} $$ where - $VCon$ is the Voluntary Contribution ## 3rd Pillar -The private fund ($Pillar3$) at year $t$ is calculated as: +The private fund ($P_3$) at year $t$ is calculated as: -$$ Pillar 3 (t)= \sum_{t=t_0}^TVCon * e^{r(T - t)} $$ +$$ P_3 (t)= \sum_{t=t_0}^TVCon * e^{r(T - t)} $$ where @@ -407,7 +405,7 @@ where ## Tax Benefit -Granted that the marginal tax rate is provided as an input, the tax benefit ($TBe$) at year $t$ is calculated as: +Granted that the marginal tax rate is provided as an input, the tax benefits ($TBe$) at year $t$ is calculated as: $$ TBe(t) = \sum_{t=t_0}^TVCon(t) * TR(t) * e^{r(T - t)} $$ @@ -425,7 +423,7 @@ where - $Tax_{S}(t)$ is the tax bill based on the gross salary at each $t$, - $Tax_{inc}(t)$ is the tax bill based on the Taxable income at each $t$, -- $TBe(t)$ is the Tax Benefit generated by the difference of the tow. +- $TBe(t)$ is the Tax Benefits generated by the difference of the tow. Taxable income ($I$) at time $t$ is computed as: @@ -535,7 +533,7 @@ pander(Road2Retirement_to_print_Pillar3) ```{r Road2Retirement_to_print_TaxBenefit, echo = FALSE, eval=show_tax, include=show_tax} moncols <- c("Direct Tax", "Return Tax", "Total Tax") -set.caption('Tax Benefit Fund') +set.caption('Tax Benefits') Road2Retirement_to_print_TaxBenefit <- Road2Retirement_to_print %>% rename(`Direct Tax` = DirectTax) %>% rename(`Return Tax` = ReturnTax) %>% @@ -552,7 +550,7 @@ pander(Road2Retirement_to_print_TaxBenefit) In case of married couples with double income, the following considerations should be taken into account. Pension funds are individual (not familiar). However, the tax rates are familiar, i.e. number of children and marital status are considered. That implies that the user can perform two calculations, both with some level of inaccuracy. -1. The user can simply enter all the information individually, without taking into account his partner. It that case, most likely, the tax rate will be underestimated and as a consequence the tax benefit generated. +1. The user can simply enter all the information individually, without taking into account his partner. It that case, most likely, the tax rate will be underestimated and as a consequence the tax benefits generated. 2. The user can enter the combined amount of all variables (salary, current assets and purchases). In this case, however, note that two simplifications have been taken into account. diff --git a/inst/application/server.R b/inst/application/server.R index 453a8c7..8463749 100644 --- a/inst/application/server.R +++ b/inst/application/server.R @@ -249,11 +249,11 @@ function(input, output, session) { TserieGraphData <- reactive({ Road2Retirement() %>% mutate(`Tax Benefits` = TotalTax) %>% - mutate(`Occupational Fund` = DirectP2 + ReturnP2) %>% - mutate(`Private Fund` = DirectP3 + ReturnP3) %>% + mutate(`2nd Pillar` = DirectP2 + ReturnP2) %>% + mutate(`3rd Pillar` = DirectP3 + ReturnP3) %>% select(Calendar, - `Occupational Fund`, - `Private Fund`, + `2nd Pillar`, + `3rd Pillar`, `Tax Benefits`) %>% .[, colSums(. != 0, na.rm = TRUE) > 0] }) @@ -277,9 +277,9 @@ function(input, output, session) { FotoFinish <- reactive({ Road2Retirement() %>% mutate(`Tax Benefits` = TotalTax) %>% - mutate(`Occupational Fund` = DirectP2 + ReturnP2) %>% - mutate(`Private Fund` = DirectP3 + ReturnP3) %>% - select(`Occupational Fund`, `Private Fund`, `Tax Benefits`) %>% + mutate(`2nd Pillar` = DirectP2 + ReturnP2) %>% + mutate(`3rd Pillar` = DirectP3 + ReturnP3) %>% + select(`2nd Pillar`, `3rd Pillar`, `Tax Benefits`) %>% tail(1) %>% prop.table() %>% select_if(function(x) diff --git a/man/buildTaxBenefits.Rd b/man/buildTaxBenefits.Rd index e9bbcd2..d6580dd 100644 --- a/man/buildTaxBenefits.Rd +++ b/man/buildTaxBenefits.Rd @@ -36,7 +36,7 @@ buildTaxBenefits(birthday, TypePurchase, P2purchase, P3purchase, returnP3, \item{RetirementAge}{Age of retirement.} } \value{ -data.frame tax benefit path. +data.frame tax benefits path. } \description{ All inputs are scalars. Builds a data frame as long as the years to retirement. diff --git a/man/calcTaxBenefitSwiss.Rd b/man/calcTaxBenefitSwiss.Rd index c5956a8..928460a 100644 --- a/man/calcTaxBenefitSwiss.Rd +++ b/man/calcTaxBenefitSwiss.Rd @@ -23,10 +23,10 @@ calcTaxBenefitSwiss(ExpectedSalaryPath, TaxableIncome, rate_group, Age, \item{churchtax}{Y/N \code{Character} Y/N} } \value{ -Single tax benefit (tax relief) of one contribution. +Single tax benefits (tax relief) of one contribution. } \description{ -Calculates the tax benefit as a difference of the taxes paid with and without retirement contributions. +Calculates the tax benefits as a difference of the taxes paid with and without retirement contributions. Calls 'getTaxAmount()', therefore, it assumes objects in the global environment. } \examples{ diff --git a/vignettes/smarp_user_manual.Rmd b/vignettes/smarp_user_manual.Rmd index 4d27a29..94d21d5 100644 --- a/vignettes/smarp_user_manual.Rmd +++ b/vignettes/smarp_user_manual.Rmd @@ -73,13 +73,13 @@ The third panel is the private fund. It is non-compulsory and only includes annu The text box above the plots summarizes the total pension fund the user will get at the end of his working life.[^5] -The total pension fund can be divided in three components: Occupational fund, Private fund and tax benefits fund. +The total pension fund can be divided in three components: Occupational fund, Private fund and tax benefits. -**The tax benefits fund** cannot be directly capitalized as the other two, but is generated indirectly through tax relieves coming from contributions to the other funds. +**The tax benefits** cannot be directly capitalized as the other two, but is generated indirectly through tax relieves coming from contributions to the other funds. -There are some important notes to consider about the tax benefits fund. +There are some important notes to consider about the tax benefits. -- Contributions are calculated as the tax relief is generated and therefore are related to the marginal tax rate of each individual. The higher the tax rate, the higher the tax relief and thus the tax benefits fund. +- Contributions are calculated as the tax relief is generated and therefore are related to the marginal tax rate of each individual. The higher the tax rate, the higher the tax relief and thus the tax benefits. - The cap on the tax relief is defined by the Swiss federal government. From fa73f99d2f3959621b603ecbda306f5e449dc1b8 Mon Sep 17 00:00:00 2001 From: Riccardo Porreca Date: Tue, 11 Jun 2019 18:07:21 +0200 Subject: [PATCH 33/33] 1.2.0 release preps * closes #103 * closes #129 * closes #108 * closes #101 * closes #118 * closes #119 * closes #123 * closes #125 * closes #120 --- DESCRIPTION | 2 +- NEWS.md | 31 +++++++++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 06deedd..4a1f220 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: SmaRP Title: SmaRP: Smart Retirement Planning -Version: 1.1.1-9000 +Version: 1.2.0 Authors@R: c(person("Gabriel", "Foix", role = c("aut", "cre"), email = "gabriel.foix@mirai-solutions.com"), person("Francesca", "Vitalini", role = c("aut"), diff --git a/NEWS.md b/NEWS.md index d6a5b5a..b19a01f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,16 +1,23 @@ -# SmaRP 1.1.1-9000 - -* launch_application() exposes the launch.browser argument to shiny::runApp (#108). -* Updated install_github() README instructions due to un-supported build_vignettes argument (#120). -* Automatic cleanup of data created via configure (#119). -* Background header does not re-center with increasing page width (#123). -* DESCRIPTION file includes URL and BugReports sections (#125). -* Made a few syntax changes in vignettes (#101). -* Changed Pillars nomenclature to be consistent with official terminology (#103). -* Annual Contribution initialized at 5000, numericInput re-set to 0 or minimum -value if lower number is inserted, unused maximum values erased (#129). -* Fixed missing page title (#118). +# SmaRP 1.2.0 +### Changes + +* The naming of pension funds was reviewed and aligned, and now reflects the official terminology (#103). +* The 3rd Pillar annual contribution in the app is now initialized with a non-zero value (#129). +* Negative input values are now re-set to zero, and maximum allowed values were consolidated (#129). +* `launch_application()` exposes the `launch.browser` argument of `shiny::runApp()` (#108). +* Minor updates to package vignettes (#101). + +### Fixes + +* Missing page title in the app (#118). +* Missing automatic cleanup of data created via configure (#119). +* App header background image re-centering upon page resize (#123). + +### Maintenance + +* Included `URL` and `BugReports` in DESCRIPTION file (#125). +* Updated `install_github()` README instructions due to un-supported `build_vignettes` argument (#120). # SmaRP 1.1.1