title: Error: Invalid First Argument
body: <p>I'm getting an "invalid first argument" error for the following. However, con is an actual connection and is set up properly. So what does this error actually refer to? </p>
  
  <pre><code>library(dplyr)
  con &lt;- RSQLServer::src_sqlserver("***", database = "***")
  
  myData &lt;- con %&gt;%
    tbl("table") %&gt;%
    group_by( work_dt, campaign, ad_group, matchtype, keyword ) %&gt;%
    select( work_dt, campaign, ad_group, matchtype, keyword, impressions, clicks, cost ) %&gt;%
    filter(site_id %in% c(6932,6946,6948,6949,6951,6952,6953,6954,
                          6955,6964,6978,6979,7061,7260,7272,7329,
                          7791,7794,7850,7858,7983)) %&gt;% 
    filter(work_dt &gt;= as.Date("2014-10-01 00:00:00") &amp; work_dt &lt; as.Date("2014-10-02 00:00:00")) %&gt;%
    summarise(
      sum_impressions = sum(impressions),
      sum_clicks = sum(clicks),
      sum_cost = sum(cost),
    ) %&gt;%
    collect() 
  </code></pre>
  
  <p>This code produces:</p>
  
  <pre><code>Error in exists(name, env) : invalid first argument
  
  
  
  exists("con")
  
  &gt; exists(con)
  Error in exists(con) : invalid first argument
  &gt; exists("con")
  [1] TRUE
  </code></pre>