title: Exclude Weekends in Dot in Dplyr
body: <p>This is a continuation question from this answer: <a href="https://stackoverflow.com/a/45254762/5893585">https://stackoverflow.com/a/45254762/5893585</a></p>
  <p>I am using the <code>do</code> function in <code>dplyr</code> within the <code>prophet</code> package. When attempting this I want to make a future dataframe with weekends excluded. Below is my current code:</p>
  <p>Current dataframe:</p>
  <pre><code>dataset
            ds     group     y
    2021-12-15         A     5
    2021-12-16         A     6
    2021-12-15         B    10
    2021-12-16         B     7
           etc       etc   etc
  </code></pre>
  <p>Prediction</p>
  <pre><code>library(dplyr)
  library(prophet)
  
  data = dataset %&gt;%  
  group_by(group) %&gt;%
  do(predict(prophet(., daily.seasonality = TRUE, yearly.seasonality = TRUE), 
  make_future_dataframe(prophet(.,daily.seasonality = TRUE, yearly.seasonality = TRUE), periods = 14))) %&gt;%
  select(ds, group, yhat)
  </code></pre>
  <p>How do I rewrite the above code to filter for the <code>make_future_dataframe</code> dataset not have weekends?</p>
  <p>I want it to looks something like this, however this is not working:</p>
  <pre><code>data = dataset %&gt;%  
    group_by(group) %&gt;%
    do(predict(prophet(., daily.seasonality = TRUE, yearly.seasonality = TRUE), 
    make_future_dataframe(prophet(.[which(weekdays(.$ds) != 'Saturday' | weekdays(.$ds) != 'Sunday'),],daily.seasonality = TRUE, yearly.seasonality = TRUE), periods = 14))) %&gt;%
    select(ds, group, yhat)
  </code></pre>