title: Error in if (is.na(n) || n > 65536L) stop("size cannot be NA nor exceed 65536")
body: <p>I want to perform hierarchical clustering on an object generated by <code>Rtsne()</code>. <code>Rtsne</code> gives a list, that I converted to a <code>data.frame</code>.  Then I used <code>dist</code>on it, followed by <code>hclust()</code>. 
  But this gives me the error <code>Error in if (is.na(n) || n &gt; 65536L) stop("size cannot be NA nor exceed 65536") : 
   missing value, where TRUE/FALSE are needed</code></p>
  
  <p>No <code>NA</code> values are in any object</p>
  
  <pre><code>tsne &lt;- Rtsne(df[!duplicated(df), -14],check_duplicates=F)
  tsne &lt;- as.data.frame(tsne)
  tsne_dist &lt;- dist(tsne,method="euclidean")
  hc_tsne &lt;- hclust(tsne,method = "average")
  class(tsne)
  [1] "list"
  &gt; any(is.na(tsne))
  [1] FALSE
  </code></pre>
  
  <p>I know that is not a real repex. But I cannot generate a dummy example and established example datasets like <code>iris</code> could not reproduce the error. Nonetheless, I hope somebody can help me.
  I have seen <a href="https://stackoverflow.com/questions/52391558/hierarchical-clustering-using-cosine-distance-in-r">Hierarchical clustering using cosine distance in R</a> </p>