title: Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘n’ for signature ‘"missing"’
body: <p>I'm getting Error in (function (classes, fdef, mtable)  : unable to find an inherited method for function ‘n’ for signature ‘"missing"’ and I wasn't able to figure out where the problem is.</p>
  
  <p>I'm following the example <a href="http://datafeedtoolbox.com/visualizing-the-customer-journey-with-r-and-adobe-analytics-data-feeds/" rel="nofollow noreferrer">Visualizing the Customer Journey with R and Adobe Analytics Data Feeds</a> by Trevor Paulsen  with my own data. I'm providing an example of my data below.</p>
  
  <pre><code>library(dplyr)
  library(plotly)
  
  ##data example
  newdata &lt;- data.frame(customer_id = c(
  10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133
  ,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133
  ,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133
  ,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133
  ,10002133,10002133,10002133,10002133,10002133,10002133,10002133,10002133)
  ,f_ev = c('hb - transferencias','hb - transferencias','hb - error acceso transferencias'
  ,'hb - error acceso error app transferencias','hb - error acceso'
  ,'hb - consulta transferencias','hb - consulta transferencias','hb - consulta transferencias'
  ,'hb - consulta transferencias','hb - consulta transferencias','hb - consulta transferencias'
  ,'hb - consulta transferencias','hb - consulta transferencias','hb - consulta transferencias'
  ,'hb - consulta transferencias','hb - consulta transferencias','hb - consulta transferencias'
  ,'hb - consulta transferencias','hb - consulta transferencias','hb - consulta transferencias'
  ,'hb - consulta transferencias','hb - consulta pago transferencias','hb - consulta pago transferencias'
  ,'hb - consulta pago transferencias','hb - consulta pago','hb - consulta pago'
  ,'hb - consulta error app transferencias','hb - consulta error app transferencias'
  ,'hb - consulta error app transferencias','hb - consulta error app pago transferencias'
  ,'hb - consulta error app','hb - consulta error acceso transferencias','hb - consulta'
  ,'hb - consulta','hb - consulta','hb - consulta','hb - consulta','hb - consulta'
  ,'hb - consulta','hb - consulta','hb - consulta','hb - consulta','hb - consulta'
  ,'hb - consulta','hb - consulta','hb - consulta','hb - consulta'
  ,'hb - alerta producto o servicio consulta transferencias','hb - alerta producto o servicio consulta error app'
  ,'hb - alerta producto o servicio consulta','hb - alerta producto o servicio consulta'
  ,'hb - alerta producto o servicio consulta')
  ,conversion = c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
  ,order_seq = c(52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20
  ,19,18,17,16,15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
  )
  
  ##path generation
  paths_stacks = newdata %&gt;% 
    group_by(customer_id) %&gt;% 
    summarize(path = paste0(f_ev, collapse =  " &gt; "),
              conversion = max(conversion)) %&gt;% 
    ungroup() %&gt;%
    group_by(path) %&gt;%
    summarize(
      conversion = sum(conversion),
      path_count = n()
    ) %&gt;% ungroup() %&gt;%
    mutate(
      conversion_rate = conversion/path_count
    ) 
  
  </code></pre>
  
  <p>The result is an error:</p>
  
  <p>Error in (function (classes, fdef, mtable)  : 
    unable to find an inherited method for function ‘n’ for signature ‘"missing"’</p>