This package allows the user to run Monte Carlo simulation on the fiscal impact of subway PPP. This version is focused only on line4 yellow. Future versions will include Rio de Janeiro's VLT.
You can install the github version of line4PPPsim from CRAN with:
library(devtools)
devtools::intall_github("mgaldino/line4PPPsim")
Como analisar impacto de ajuste de demanda com simulação.
library(line4PPPsim)
library(dplyr)
#> Warning: package 'dplyr' was built under R version 3.5.1
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 3.5.1
resultado <- sim_sensibilidade_line4(n_sim = 100, num_years = 33, start_seed = 1, mu = 0, sd= .05, ajuste_inflacao = F, type="random_walk")
#> Warning: package 'bindrcpp' was built under R version 3.5.1
result_sim <- resultado[[1]]
result_sim %>% ggplot(aes(x=ano, y=diferenca, group = sim)) +
geom_line() + ylab("diferença entre realizado e previsto") +
scale_y_continuous(labels = scales::comma_format(prefix = "R$ ",big.mark = ".", decimal.mark = ",")) +
theme_bid()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.