[R] sqlQuery and string selection

From: Jérôme Lemaître <je_lemaitre_at_hotmail.com>
Date: Thu 20 Oct 2005 - 07:25:31 EST


Dear alls,

Could someone tell me how to select a subset of string observations (e.g. "females" in a sex column) with sqlQuery in the RODBC library?

Indeed, I'm trying to select a subset of observations on my access database with:

female<-sqlQuery(mychannel,"SELECT Micromammiferes.sex FROM Micromammiferes
WHERE (((Micromammiferes.sex)="females"));")

The sql works well in access but in R, I keep getting:

Error: syntax error.

Any help would be very appreciated,

Thanks a lot

Jérôme Lemaître
Ph.D. student
Départment of biology,
University Laval
Quebec, Canada



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 Thu Oct 20 07:29:52 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:46 EST