title: Test whether data is numeric or Factor/Ordinal
body: <p>I'm sitting with a large dataset and want to get som basic information about my variables, first of all if they are numeric or factor/ordinal.</p>
  
  <p>I'm working with a function, and want, one variable at a time, investigate if it is numeric or a factor. </p>
  
  <p>To make the for loop work I'm using dataset[i] to get to the variable I want.</p>
  
  <pre><code>object&lt;-function(dataset){
  
      n=ncol(dataset)
      for(i in 1:n){
         variable_name&lt;-names(dataset[i])
         factor&lt;-is.factor(dataset[i])
         rdered&lt;-is.ordered(dataset[i])
         numeric&lt;-is.numeric(dataset[i])
         print(list(variable_name,factor,ordered,numeric))
      }
  }
  </code></pre>
  
  <p>is.ordered
  My problem is that is.numeric() does not seem to work with dataset[i], all the results becomes "FALSE", but only with dataset$.</p>
  
  <p>Do you have any idea how to solve this?</p>