[R] as.data.frame question
andy_liaw at merck.com
Thu Jul 6 19:00:45 CEST 2006
You shouldn't need the as.data.frame(), as sqlFetch() already returns
a data.frame. You could try adding the as.is argument to sqlFetch()
(see how it's specified in ?read.table), or else convert them
From: ruser ruser
> I'm using the RODBC library to read in an Excel file using
> the odbcConnectExcel function. I can read the Excel data
> prefectly, however all my character variables get converted
> to factors when using
> my.data <- as.data.frame(sqlFetch(channel, "Sheet1"))
> I've tried using
> my.data <- as.data.frame(I(sqlFetch(channel, "Sheet1")))
> but this creates just one column of data. Is there an
> efficient way to read in the character variables from my
> Excel data as characters rather than converting them to factors.
> Any help is much appreciated.
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide!
More information about the R-help