[R] a question on sqldf's handling of missing value and factor

xin wei xinwei at stat.psu.edu
Wed Mar 2 05:52:51 CET 2011


Dear subscribers:

I am using the following code to read a large number of big text files:
library(sqldf)
tempd <- file(XXXX)
tempdx <- sqldf("select * from tempd", dbname = tempfile(), file.format =
list(header = T, sep="\t", row.names = F))

The problem is: all my numberical variable become factor (maybe because
these columns all contain missing value). It would be quite cubersome to
convert them to numeric variable using as.numeric one by one. Does anyone
know how to re-set SQLDF so that it would automatically read the numeric
column with missing row as real numeric instead of factor?

many thanks

-- 
View this message in context: http://r.789695.n4.nabble.com/a-question-on-sqldf-s-handling-of-missing-value-and-factor-tp3331007p3331007.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list