title: Getting errors while using neuralnet function
body: <p>I tried neural net in R on Boston data set available.</p>
  
  <pre><code>data("Boston",package="MASS") 
  data &lt;- Boston
  </code></pre>
  
  <p>Retaining only those variable we want to use:</p>
  
  <pre><code>keeps &lt;- c("crim", "indus", "nox", "rm" , "age", "dis", "tax" ,"ptratio", "lstat" ,"medv" ) 
  data &lt;- data[keeps]
  </code></pre>
  
  <p>In this case the formula is stored in an R object called f. 
  The response variable medv is to be “regressed” against the remaining nine attributes. I have done it as below:</p>
  
  <pre><code>f &lt;- medv ~ crim + indus + nox + rm + age + dis + tax + ptratio + lstat
  </code></pre>
  
  <p>To set up train sample  400 of the 506 rows of data without replacement is collected using the sample method:</p>
  
  <pre><code>set.seed(2016) 
  n = nrow(data) 
  train &lt;- sample(1:n, 400, FALSE)
  </code></pre>
  
  <p>neuralnet function of R is fitted.</p>
  
  <pre><code>library(neuralnet)
  fit&lt;- neuralnet(f, data = data[train ,], hidden=c(10 ,12 ,20), 
                   algorithm = "rprop+", err.fct = "sse", act.fct = "logistic", 
                   threshold =0.1, linear.output=TRUE)
  </code></pre>
  
  <p>But warning message is displayed as algorithm not converging.</p>
  
  <p>Warning message:
  algorithm did not converge in 1 of 1 repetition(s) within the stepmax </p>
  
  <p>Tried Prediction using compute,</p>
  
  <pre><code> pred &lt;- compute(fit,data[-train, 1:9])
  </code></pre>
  
  <p>Following error msg is displayed</p>
  
  <pre><code>Error in nrow[w] * ncol[w] : non-numeric argument to binary operator
  In addition: Warning message:
  In is.na(weights) : is.na() applied to non-(list or vector) of type 'NULL'
  </code></pre>
  
  <p>Why the error is coming up and how to recover from it for prediction. I want to use the neuralnet function on that data set.</p>