title: importing a matrix consists of both strings and numerical values
body: <p>When reading a csv file, where each cell can be strings or numerical values. Which approach should I use to read this csv file into a matrix. The tricky thing is that I may need to perform some computation on this imported matrix. If an entry is a string, I need to perform some character-based operation on this string, e.g., comparing it with another string. If an entry is an numerical value, I need to perform a add/subtract operation on it.  How should I import this csv file:</p>
  
  <pre><code>testmatrix = as.character(read.csv("test.csv", sep=","))
  testmatrix = as.vector(read.csv("test.csv", sep=","))
  </code></pre>
  
  <p>The data is like this</p>
  
  <pre><code>word1   word2   123  word3
  234     456     word4  word5
  </code></pre>