title: Why does object '..JSON' not found error occur using tidyjson package, bind_rows, and mutate together in R?
body: <p>Does anyone know why an error occurs using the tidyjson package, bind_rows(), and mutate() together in the following example?</p>
  
  <pre><code>library(tidyjson)
  library(dplyr)
  
  # Define a simple JSON array
  people &lt;- '
  [
      {
      "name": "bob",
      "age": 32
      }, 
      {
      "name": "susan", 
      "age": 54
      }
  ]'
  
  # Structure the data
  people_df &lt;- people %&gt;%
      gather_array %&gt;%
      spread_values(
          name = jstring("name"),
          age = jnumber("age"))
  </code></pre>
  
  <p>Using <code>bind_rows()</code> and <code>mutate()</code> together seems to cause an error:</p>
  
  <pre><code>people_df2 &lt;- people_df %&gt;%
      bind_rows(people_df) %&gt;%
      mutate(city = "toronto")
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Error in eval(expr, envir, enclos) : object '..JSON' not found
  </code></pre>
  
  <p>However, using only <code>bind_rows()</code> or <code>mutate()</code> or adding in <code>as_data_frame()</code> work:</p>
  
  <pre><code>people_df2 &lt;- people_df %&gt;%
      bind_rows(people_df)
  
  people_df2 &lt;- people_df %&gt;%
      mutate(city = "toronto")
  
  people_df2 &lt;- people_df %&gt;%
      as_data_frame() %&gt;%
      bind_rows(people_df) %&gt;%
      mutate(city = "toronto")
  </code></pre>