title: R: How to plot Line chart with multiple filterers. (R-shiny / flexdashboard)
body: <p>R: How to plot Line chart with multiple filterers. (R-shiny / flexdashboard).</p>
  
  <p>I want to plot line chart with average present value from total no. of events employees have attended.</p>
  
  <p><strong>Exmp:</strong>
  Total events for employee A in 01/2019 is 4 where he was only present in 1 then it should display 25% result for that month. ((1/4) * 100) %</p>
  
  <p>Here is the sample data but in actuality there are 100+ employees,
  So result should be required as line colour code by employee name. </p>
  
  <p>Data set like:</p>
  
  <pre><code>Employee        Status          Month_Yr
  A               PRESENT         01/2019
  C               PRESENT         01/2019
  B               PRESENT         01/2019
  C               PRESENT         02/2019
  D               PRESENT         03/2019
  A               PRESENT         01/2019
  B               PRESENT         03/2019
  C               PRESENT         01/2019
  B               ABSENT          01/2019
  D               ABSENT          01/2019
  A               ABSENT          01/2019
  C               PRESENT         02/2019
  B               PRESENT         01/2019
  A               PRESENT         02/2019
  A               ABSENT          02/2019
  D               ABSENT          03/2019
  C               PRESENT         01/2019
  C               ABSENT          01/2019
  C               ABSENT          01/2019
  A               ABSENT          02/2019
  C               ABSENT          04/2019
  B               ABSENT          01/2019
  </code></pre>
  
  <p>Code I tried:</p>
  
  <pre><code>sub_data5 &lt;-mutate(sub_data5, ontime = ifelse(sub_data5$Status=="PRESENT","Y","N"))
  
  
  sub_data5 &lt;- sub_data5 %&gt;% 
      count(year_month, Employee, ontime,year,Month) %&gt;% 
      group_by(year_month, Employee,year,Month) %&gt;% 
      mutate(Prop = (n/sum(n))*100)
  
  sub_data5$`Prop`  &lt;- as.integer(sub_data5$`Prop`)
  
  ggplot(sub_data5, aes(x=year_month, y=Prop, group=Employee, color=Employee)) +
    geom_line()
  </code></pre>
  
  <p>But I want to display a line plot with filters of year_month,Employee,year,Month.</p>
  
  <p>Like we get filters in rpivottable check attached Image.</p>
  
  <p><a href="https://i.stack.imgur.com/MNGtP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MNGtP.jpg" alt="enter image description here"></a></p>