title: For Loop and If in R Programming
body: <p>I think I have a simple question, but I can not figure out how to do it.
  I just wanna plot all hist of an data input and check if all var are numerical.</p>
  
  <pre><code>plotting_histogram_data&lt;-function(x) {
    for(i in seq_len((ncol(x)))) {
      if(is.numeric(x[,i])) { 
        hist(x[,i])
      }
      else{
        print("Variable is not of the Typ numeric!")
      }
      }
  }
  </code></pre>
  
  <p>I know that the problem is the index. </p>
  
  <p>Thank and have nice day.</p>