1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| # server.R
# construction d'un tableau d'amortissement
dfAmortMorgage=reactive({
AmortHead <- c("MaturityNb", "RemainingNb", "MaturityDate", "Age", "RemainingCapital", "InterestPaid", "CapitalReimbursed", "Insurance", "Fees", "Tax", "AmountPerPeriod")
Amort <- matrix(NA,loan_duration,length(AmortHead))
colnames(Amort) <- AmortHead
.....
Amort.table <- as.table(Amort)
}
#
output$tableAmortMorgage <- renderDataTable({
dfAmortMorgage()
})
output$uiLoanRecapTable <- renderUI({
# Récapitulatif du contrat emprunteur avec les éléments du tableau d'amortissement "tableAmortMorgage"
dtAmortMorgage <- renderDataTable(dfAmortMorgage)
# En débuggant, le message d'erreur object of type 'closure' is not subsettable
# Dans cette partie, je souhaite utiliser la table "dfAmortMorgage" pour faire la somme de chaque colonne.
# Comment faire ?
sumInsurance <- c(sum(dtAmortMorgage $Insurance))
sumFees <- c(sum(dtAmortMorgage $Fees))
...
}) |
Partager