title: R programming regarding types conversion
body: <p>I am trying to convert the data types in order to correctly plot the data.</p>
  
  <p>In my opinion, my codes are a little bit complex and are not effective.</p>
  
  <p>Therefore, I would like to ask some advice for better codes.</p>
  
  <p>Below are my codes.</p>
  
  <pre><code>pos &lt;- as.matrix(read.delim("urc_pos",header=FALSE))
  neg &lt;- as.matrix(read.delim("urc_neg",header=FALSE))
  rownames(pos) &lt;- 1:nrow(pos)
  pos_temp &lt;- cbind("pos",pos[,3:42])
  pos_temp_temp &lt;- as.data.frame(pos_temp)
  for(i in 2:41)
  {
      pos_temp_temp[,i] &lt;- as.numeric(as.character(pos_temp_temp[,i]))
  }
  </code></pre>
  
  <p>urc_pos and urc_neg are my datasets.</p>
  
  <p>For example, when I typed "is.numeric(pos[3,3])", it returned false because it was a vector. Therefore converting its data type to numeric type is necessary. After then, I assigned the row numbers and added label "pos" at the first column.</p>
  
  <p>And below are the codes that convert the vector types to numerical type.
  I think that it is a little bit complex and is unfavorable. Because I think that unnecessary procedures including converting data types ( data.frame -> character-> numerical) are involved in the for loops. </p>
  
  <pre><code>pos_temp_temp &lt;- as.data.frame(pos_temp)
  for(i in 2:41)
  {
      pos_temp_temp[,i] &lt;- as.numeric(as.character(pos_temp_temp[,i]))
  }
  </code></pre>
  
  <p>Anyway, I got the what I intended. when I typed "is.numeric(pos_temp_temp[3,3])", it returned TRUE.</p>
  
  <p>However, I want to get the better solutions for this problems. 
  I am looking forward to your answer :D</p>