title: Is it possible to add an exception to summarize(count = n_distinct(x)) in R?
body: <p>Is it possible to add an exception to <code>summarize(count = n_distinct(x))</code> in R, while allowing the exception to be counted by the "normal" <code>summarize(count = n()) function</code>?</p>
  
  <p>How do you combine the count <code>n()</code> and <code>n_distinct()</code> functions to create a single new column?</p>
  
  <p>This way, I could summarize the distinct count of observations in column <code>x</code>, while adding an exception in the form of an observation, which would not be limited to a distinct count, but rather be subject to the "normal" <code>summarize(count = n()) function</code>.</p>
  
  <p>For example, if <code>x = c(1, 2, 2, 4, 5, 8, 8, ..., 99)</code>, I could summarize the distinct counts of all observations except, say, the observation <code>8</code> in column <code>x</code>. The observation <code>8</code> would instead be subject to the <code>summarize(count = n()) function</code>. This would then count the number of <code>8</code>'s plus the number of other unique values in <code>x</code>.</p>
  
  <p>In conclusion, this would create a single new column "count", in which all values would be from the distinct count, except for the one exception, whose value would come from the "normal" count.</p>