Re: [R] as.data.frame question

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Fri 07 Jul 2006 - 03:00:45 EST


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 afterward.

Andy

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.
>
> Regards,
>
> Harry
>
>
>
> ---------------------------------
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jul 07 04:14:57 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 07 Jul 2006 - 06:15:04 EST.

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