[R] sqlQuery and string selection
paul at metrak.com
Thu Oct 20 00:04:41 CEST 2005
Jérôme Lemaître wrote:
> 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
> 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.
R is likely to have problems with nested quote characters.
x = "SELECT Micromammiferes.sex FROM Micromammiferes WHERE
also results in a syntax error (my mailer split the line).
More information about the R-help