title: How does stringsAsFactors in data.frame() work?
body: <pre><code>data &lt;- sqlQuery(connection, "SELECT col1, col2, col3 FROM table1")
  
  d &lt;- data.frame(data, stringsAsFactors = FALSE)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>transform(d, col1 = as.character(col1), stringsAsFactors = FALSE)
  </code></pre>
  
  <p><code>d</code> in this cases still has <code>factor</code> type of columns.</p>
  
  <pre><code>str(d)
  
  'd': 1943 obs. of 4 variables:
  $ col1: Factor w/ 5 levels ....
  </code></pre>
  
  <p>But when I first state;</p>
  
  <pre><code>options(stringsAsFactors = FALSE)
  </code></pre>
  
  <p>it works, but it sets it globally. Why do inside-statements has no effect?</p>