Skip to content

Commit

Permalink
Merge pull request #107 from miraisolutions/develop
Browse files Browse the repository at this point in the history
1.1.1 release
  • Loading branch information
RolandASc authored Mar 22, 2019
2 parents 75b9d4a + 2fe14f1 commit 75b6fc9
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 22 deletions.
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: SmaRP
Title: SmaRP: Smart Retirement Planning
Version: 1.1.0
Version: 1.1.1
Authors@R: c(person("Gabriel", "Foix", role = c("aut", "cre"),
email = "[email protected]"),
person("Francesca", "Vitalini", role = c("aut"),
Expand Down Expand Up @@ -33,8 +33,7 @@ Imports:
rmarkdown,
shiny,
shinydashboardPlus,
shinyWidgets,
webshot
shinyWidgets
Suggests: testthat, roxygen2 (>= 6.1.1)
VignetteBuilder: knitr
RoxygenNote: 6.1.1
Expand Down
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM rocker/r-ver:3.5.1

MAINTAINER Nicola Lambiase "[email protected]"

RUN apt-get update && apt-get install -y \
sudo \
pandoc \
Expand Down Expand Up @@ -32,11 +30,8 @@ RUN install2.r --error \
rmarkdown \
shiny \
shinydashboardPlus \
shinyWidgets \
webshot

# install PhantomJS
RUN R -e "library(webshot); webshot::install_phantomjs()"
shinyWidgets


# copy the app to the image
RUN mkdir /root/SmaRP
Expand Down
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# SmaRP 1.1.1

### Fixes

* Bar-plot missing in the PDF report (#96).
* PDF report refers to wrong pillars (#105).
* Checkboxes and radio buttons don't render properly in Safari browser (#102).

### Maintenance

* Aligned plot labels with table headers in the report.
* Removed obsolete dependency on package webshot and PhantomJS (#97).

# SmaRP 1.1.0

* Retirement age automatically resets to 70 if a higher number is inserted (#27)
Expand Down
8 changes: 4 additions & 4 deletions inst/application/report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,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 Pension" = "#008cc3", "Private Pension" = "#FF9966", "Tax Benefits" = "#13991c")) +
scale_fill_manual(NULL, values = c("Occupational Fund" = "#008cc3", "Private Fund" = "#FF9966", "Tax Benefits" = "#13991c")) +
scale_y_continuous(labels = scales::comma) +
labs(x = "Year", y = "Return [CHF]") +
geom_area(alpha = 0.6) +
Expand Down Expand Up @@ -196,11 +196,11 @@ 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_Pension" = "#008cc3", "Private_Pension" = "#FF9966", "TaxBenefits" = "#13991c")) +
scale_fill_manual(NULL, values = c("Occupational Fund" = "#008cc3", "Private Fund" = "#FF9966", "Tax Benefits" = "#13991c")) +
labs(x = NULL, y = "% Contribution of each fund at retirement") +
theme(
axis.text = element_text(size = 10),
axis.title = element_text(color="grey"),
axis.title = element_text(color = "grey"),
aspect.ratio = 0.1,
panel.background = element_rect(fill = NA),
panel.grid.major = element_line(colour = NA),
Expand All @@ -211,7 +211,7 @@ ggplot(data = barGraphData.long, aes(x = contribution, y = value, fill = variabl

<br>

The graphs above display the amounts at the end of each year for the Pillar I, Pillar II 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.
The graphs above display the amounts at the end of each year for the Pillar II, Pillar III 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.

<br>

Expand Down
14 changes: 7 additions & 7 deletions inst/application/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ function(input, output, session) {
TserieGraphData <- reactive({
Road2Retirement() %>%
mutate(`Tax Benefits` = TotalTax) %>%
mutate(`Occupational Pension` = DirectP2 + ReturnP2) %>%
mutate(`Private Pension` = DirectP3 + ReturnP3) %>%
mutate(`Occupational Fund` = DirectP2 + ReturnP2) %>%
mutate(`Private Fund` = DirectP3 + ReturnP3) %>%
select(Calendar,
`Occupational Pension`,
`Private Pension`,
`Occupational Fund`,
`Private Fund`,
`Tax Benefits`) %>%
.[, colSums(. != 0, na.rm = TRUE) > 0]
})
Expand All @@ -269,9 +269,9 @@ function(input, output, session) {
FotoFinish <- reactive({
Road2Retirement() %>%
mutate(`Tax Benefits` = TotalTax) %>%
mutate(`Occupational Pension` = DirectP2 + ReturnP2) %>%
mutate(`Private Pension` = DirectP3 + ReturnP3) %>%
select(`Occupational Pension`, `Private Pension`, `Tax Benefits`) %>%
mutate(`Occupational Fund` = DirectP2 + ReturnP2) %>%
mutate(`Private Fund` = DirectP3 + ReturnP3) %>%
select(`Occupational Fund`, `Private Fund`, `Tax Benefits`) %>%
tail(1) %>%
prop.table() %>%
select_if(function(x)
Expand Down
1 change: 0 additions & 1 deletion inst/application/www/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ label {
/* vertical radio/checkbox alignment to text */
input[type=checkbox], input[type=radio] {
margin: 1px 0 0;
border: 10px solid red;
}

.checkbox, .radio {
Expand Down

0 comments on commit 75b6fc9

Please sign in to comment.