Re: [R] RODBC and Excel: Wrong Data Type Assumed on Import

2005-11-04 Thread Earl F. Glynn
Gabor Grothendieck [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] You could try using the COM interface rather than the ODBC interface. Try code such as this: library(RDCOMClient) xls - COMCreate(Excel.Application) xls[[Workbooks]]$Open(MySpreadsheet.xls) sheet -

Re: [R] RODBC and Excel: Wrong Data Type Assumed on Import

2005-11-04 Thread Gabor Grothendieck
On 11/4/05, Earl F. Glynn [EMAIL PROTECTED] wrote: Gabor Grothendieck [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] You could try using the COM interface rather than the ODBC interface. Try code such as this: library(RDCOMClient) xls - COMCreate(Excel.Application)

Re: [R] RODBC and Excel: Wrong Data Type Assumed on Import

2005-11-03 Thread Petr Pikal
Subject:[R] RODBC and Excel: Wrong Data Type Assumed on Import The first column in my Excel sheet has mostly numbers but I need to treat it as character data: library(RODBC) channel - odbcConnectExcel(U:/efg/lab/R/Plasmid/construct list.xls) plasmid - sqlFetch(channel,Sheet1

Re: [R] RODBC and Excel: Wrong Data Type Assumed on Import

2005-11-03 Thread Kevin Wright
From my experience (somewhat of a guess): 1. Excel uses the first 16 rows of data to determine if a column is numeric or character. The data type which is most common in the first 16 rows will then be used for the whole column. If you sort the data so that at least the first 9 rows have

Re: [R] RODBC and Excel: Wrong Data Type Assumed on Import

2005-11-03 Thread Earl F. Glynn
Kevin Wright [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] From my experience (somewhat of a guess): Excel uses the first 16 rows of data to determine if a column is numeric or character. The data type which is most common in the first 16 rows will then be used for the whole

Re: [R] RODBC and Excel: Wrong Data Type Assumed on Import

2005-11-03 Thread Gabor Grothendieck
You could try using the COM interface rather than the ODBC interface. Try code such as this: library(RDCOMClient) xls - COMCreate(Excel.Application) xls[[Workbooks]]$Open(MySpreadsheet.xls) sheet - xls[[ActiveSheet]] mydata - sheet[[UsedRange]][[value]] xls$Quit() # convert mydata to a

[R] RODBC and Excel: Wrong Data Type Assumed on Import

2005-11-02 Thread Earl F. Glynn
The first column in my Excel sheet has mostly numbers but I need to treat it as character data: library(RODBC) channel - odbcConnectExcel(U:/efg/lab/R/Plasmid/construct list.xls) plasmid - sqlFetch(channel,Sheet1, as.is=TRUE) odbcClose(channel) names(plasmid) [1] Plasmid Number Plasmid