title: Error running neural net
body: <pre><code>library(nnet)
  set.seed(9850)
  train1&lt;- sample(1:155,110)
  test1 &lt;- setdiff(1:110,train1)
  ideal &lt;- class.ind(hepatitis$class)
  hepatitisANN = nnet(hepatitis[train1,-20], ideal[train1,], size=10, softmax=TRUE)
  j &lt;- predict(hepatitisANN, hepatitis[test1,-20], type="class")
  hepatitis[test1,]$class
  table(predict(hepatitisANN, hepatitis[test1,-20], type="class"),hepatitis[test1,]$class)
  confusionMatrix(hepatitis[test1,]$class, j)
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Error in nnet.default(hepatitis[train1, -20], ideal[train1, ], size = 10,  : 
    NA/NaN/Inf in foreign function call (arg 2)
  In addition: Warning message:
  In nnet.default(hepatitis[train1, -20], ideal[train1, ], size = 10,  :
    NAs introduced by coercion
  
  hepatitis variable consists of the hepatitis dataset available on UCI.
  </code></pre>