[R-sig-DB] RMySQL and factors

mikko@virt@@e@ m@iii@g oii kti@ii mikko@virt@@e@ m@iii@g oii kti@ii
Thu Feb 3 21:03:17 CET 2005


Don MacQueen <macq using llnl.gov> wrote:
> How about:
> 
> getrace <- function(connection) {
>    sql <- "SELECT race FROM PATIENT"
>    rs <- dbGetQuery(connection, sql)
> 
>    rs$trace <- factor(rs$trace)
> 
>    class(rs$race)
> }

This has the potential problem that if the data changes or the sql statement has
a WHERE in it, each run might get slightly different levels().

I guess the MySQL does have the ENUM data type, and the RSDBI does have the
hooks for using this information, but nothing seems to be implemented at the
moment.

   MJ;




More information about the R-sig-DB mailing list