Browse Source

Optimización de sqlShowSamples.

main
Costa 3 years ago
parent
commit
126b8c4ee2
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      sqlFunctions.R

+ 2
- 2
sqlFunctions.R

@ -40,8 +40,8 @@ sqlShowSamples<-function(conn=dta, nhcs=nhc.test, verb=F, dbtype){
}
if (isFALSE(verb)){
sqlQuery(conn, query) %>% filter(NHC %in% nhcs) %>%
group_by(NHC,db["dbcode"]) %>% summarise(Samples=length(UQ(rlang::sym(db["dbsamples"]))), Names=paste0(UQ(rlang::sym(db["dbsamples"])), collapse = ";")) %>%
merge(data.frame(NHC=nhcs),all=T) %>% rename((!!db["dbcode"]):='db["dbcode"]')
group_by(NHC,UQ(rlang::sym(db["dbcode"]))) %>% summarise(Samples=length(UQ(rlang::sym(db["dbsamples"]))), Names=paste0(UQ(rlang::sym(db["dbsamples"])), collapse = ";")) %>%
merge(data.frame(NHC=nhcs),all=T) %>% mutate(NHC=factor(NHC,levels = nhcs)) %>% arrange(NHC)
}else{
sqlQuery(conn, query) %>% filter(NHC %in% nhcs)
}

Loading…
Cancel
Save