Displaying 1 result from an estimated 1 matches for "snquery".
Did you mean:
inquery
2011 Mar 18
0
apply function returning different results
...1 958 1242
1033
Here's the function code:
calc.enrichment <- function(cptdf){
if(cptdf[4] %in% cptcodes[,1]){
P.hit <- as.numeric(cptdf[6]) / sum.all.hits
return (P.hit)
} else{
return (-miss)
}
}
query.db <- function(dxdf){
snquery = dbSendQuery(connection, paste("select distinct cpt4code from
DxRxLookup where icd9code = '", dxdf[4], "'", sep = ""))
cptcodes <<- dbGetResult(snquery)
#restrict this to constrain by Rx1 and Rx2 inputs
h1 <<- which(cpt$Cpt %in% cptcod...