Re: [R] Excel to R

From: Michael A. Miller <mmiller3_at_iupui.edu>
Date: Mon 17 Jul 2006 - 23:51:49 EST

>>>>> "Bernardo" == Bernardo Rangel tura <tura@centroin.com.br> writes:

> Well I use this scripts to import the database

> require(RODBC)
> channel <- odbcConnectExcel("f:/teste.xls")
> data <- sqlFetch(channel, "Sheet1")

Just convert qw to a factor:

require(RODBC)
channel <- odbcConnectExcel("f:/teste.xls") data <- sqlFetch(channel, "Sheet1")
data$qw <- factor(data$qw)

> Tha factors variables have tha values enconde this form
> (1=Yes,2=No and 9 = NA

If you want to use those levels, you could use

data$qw <- factor(data$qw, levels=c('Yes', 'No', 'NA'))

Mike



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 Mon Jul 17 23:57:11 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 Tue 18 Jul 2006 - 00:16:34 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.