0
votes

I cannot figure out why I am getting the below error on this chunk of code. I appreciate any thoughts in advance. thank you.

Warning: Error in $: object of type 'closure' is not subsettable

Index_Percent <- reactive({input$IndexWeight})

TBA_Index_Data <- reactive({
  left_join(TBAData_Gathered,Index_Weights)

TBA_Index_Data$Index_Percentage[TBA_Index_Data$cusip == "Cash"] <- Index_Percent()

})
1

1 Answers

0
votes

From the code you are providing, it seems you are trying to load a reactive function inside itself.

the correct form would be something like this:

Index_Percent <- reactive({input$IndexWeight})

TBA_Index_Data <- reactive({
  # these variables are reactive functions? if so, you need to add () as well.
  table <- left_join(TBAData_Gathered,Index_Weights) 
  table$Index_Percentage[table$cusip == "Cash"] <- Index_Percent()
  table
})