title: List object cannot be coerced to type 'double
body: <p>I use R and when I try to run the following code:</p>
  
  <pre><code>f = scan(file="c:\\myfile.txt", sep=' ', what=list('numeric'))
  
  MY_MATRIX.M = matrix(f, ncol = 4, byrow = TRUE)
  
  Var.names = c('column1','column2', 'column3', 'column4')
  colnames(MY_MATRIX.M) = Var.names
  
  TEST = data.frame(MY_MATRIX.M)
  
  t1 = TEST[which(TEST[,4] == 0, arr.ind = TRUE),]
  t2 = TEST[which(TEST[,4] == 1, arr.ind = TRUE),]
  </code></pre>
  
  <p>I have the following error:</p>
  
  <pre><code>Error in which(TEST[,4] == 0, arr.ind = TRUE : 
    (list) object cannot be coerced to type 'double'
  </code></pre>
  
  <p>My file has 4 columns and consist of numbers like an array.
  Can anyone give me a hand on solving the problem ?</p>