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

From: xin wei <xinwei_at_stat.psu.edu>
Date: Tue, 01 Mar 2011 20:52:51 -0800 (PST)


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.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 02 Mar 2011 - 07:14:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 02 Mar 2011 - 13:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive