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