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 -
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)
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
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
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
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
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