Select fields for table output

Asked by At

I am fairly new to Shiny.I have created 3 tabpanels and the filters I use in the first tab need to apply to the next to tabs. That is done. However it seems like I need to include all fields used in the 3 tabs in the select statement for table. I do not wish to show all these fields on the first tab when I output table output$view <- renderTable({df1tables()}). Is there a way to select only which fields to show in the table on first tab?

Thank you for your help and have a fantastic day!

The filters and select statement I use on first tab:

if(input$type1=="home"){
          df1tables <- draw.data1(input$typetier) %>%
            filter(Dim_RSEQ >= minyear) %>%
            filter(Dim_RSEQ <= maxyear) %>%
            filter(Dim_HA == 'Home') %>%
              select (Dim_Country, Dim_Season, Dim_League, Dim_Team, Dim_RSEQ, Dim_HA, Fct_Rank, Fct_Indicator, Fct_pt, Fct_Goal, Fct_Gd, Fct_WDL, Fct_FTR, Fct_Vpt, Fct_Strength, Fct_Trend)
        }

If I remove Fct_Rank, Fct_Indicator, Fct_pt, Fct_Goal, Fct_Gd, Fct_WDL, Fct_FTR, Fct_Vpt, Fct_Strength, Fct_Trend then I get an error on the third tab where these are needed.

I only want to show the following in the table on the first tab: Dim_Country, Dim_Season, Dim_League, Dim_Team, Dim_RSEQ, Dim_HA

0 Answers