Here is a screen shot I would like, the cusip value should be to the right of the label "Cusip :". After research all afternoon it seems I will have to access the value of each slot of the class MBSDetails individually. So, I would consider today a victory if all I could do is something as simple as
Bond ID: bondlabMBS4
Cusip : 23456
Here is the shiny code
server.R
library(BondLab)
library(DT)
shinyServer(function(input, output) {
MBS.Data <- reactive({MBS(MBS.id = input$bond.id)})
PassThrough.1 <- reactive({PassThroughAnalytics(bond.id = input$bond.id,
original.bal = input$OrigFace,
price = 105,
trade.date = "01-10-2013",
settlement.date = "01-13-2013",
scenario.set = "NC",
PrepaymentAssumption = "CPR",
CPR = input$CPR1)
})
PassThrough.2 <- reactive({PassThroughAnalytics(bond.id = input$bond.id,
original.bal = input$OrigFace,
price = 105,
trade.date = "01-10-2013",
settlement.date = "01-13-2013",
scenario.set = "NC",
PrepaymentAssumption = "CPR",
CPR = input$CPR2)
})
output$Cusip <- renderText("Cusip :")
output$CusipValue <- renderText({MBS.Data()@Cusip})
output$des <- renderText({MBS.Data()@ID})
output$cusip <- renderText({MBS.Data()@Cusip})
output$coupon <- renderText({MBS.Data()@Coupon})
output$gwac <- renderText({MBS.Data()@GWac})
})
ui.R
shinyUI(fluidPage(
titlePanel("Bond Lab Mortgage Analytics"),
sidebarLayout(
sidebarPanel(
helpText("Bond Data Inputs"),
textInput("bond.id",
label = "Cusip"),
numericInput("OrigFace",
label = "Original Face",
value = NULL,
min = 1000,
max = 1000000),
numericInput("Price",
label = "Price",
value = 100,
min = 0,
max = 200,
step = 1/128),
dateInput("Trade.Date",
label = "Trade Date"),
dateInput("Settlement.Date",
label = "Settlement Date" ),
width = 2
),
mainPanel(
navbarPage(
title = 'Analytics',
tabPanel('Bond Details',
textOutput("Cusip"),
textOutput("cusip")),
tabPanel('Yield Table'),
tabPanel('Scenario Analysis'),
tabPanel('OAS Analysis')
)
)
)
))
Error in library(BondLab) : there is no package called ‘BondLab’
> install.packages("BondLab")
Installing package into ‘/home/bessy/R/x86_64-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘BondLab’ is not available (for R version 3.1.1)
> devtools::install_github("rstudio/BondLab")
Downloading github repo rstudio/BondLab@master
Erreur dans download(dest, src, auth) : client error: (404) Not Found
> devtools::install_github("glennmschultz/BondLab")
ERROR: dependency ‘termstrc’ is not available for package ‘BondLab’
* removing ‘/home/bessy/R/x86_64-pc-linux-gnu-library/3.1/BondLab’
Erreur : Command failed (1)
De plus : Messages d'avis :
1: In utils::install.packages(deps, dependencies = NA, Ncpus = threads) :
installation of package ‘rgl’ had non-zero exit status
2: In utils::install.packages(deps, dependencies = NA, Ncpus = threads) :
installation of package ‘termstrc’ had non-zero exit status