Browse Source

Separar ruta de la base de datos de script principal.

main
Costa 3 years ago
parent
commit
e09e2c6344
2 changed files with 4 additions and 2 deletions
  1. +3
    -2
      RellenarOVBD.R
  2. +1
    -0
      ruta_database.R

+ 3
- 2
RellenarOVBD.R

@ -11,7 +11,8 @@ library(openxlsx)
source("sqlFunctions.R")
## Conexión a la base de datos
dta<-odbcConnectAccess2007(access.file = "C:/Users/47926492N/OneDrive - IDIBELL - Institut d'Investigació Biomèdica de Bellvitge/RATG-PIULATS/OVARIO.accdb",
source("ruta_database.R", encoding = "UTF-8")
dta<-odbcConnectAccess2007(access.file = file,
pwd = .rs.askForPassword("Enter password:"))
## Importamos los NHC de las muestras nuevas
@ -39,7 +40,7 @@ next.num<-gsub("OVID","",ovid$OVID) %>% as.numeric %>% max(na.rm=T)+1
last.num<-next.num+(length(new.nhc)-1)
upd.ovid<-rbind(ovid,data.frame("NHC"=new.nhc, "OVID"=sprintf("OVID%04d",next.num:last.num)))
rownames(upd.ovid)<-as.character(1:nrow(upd.ovid))
upd.ovid<-filter(upd.ovid, NHC %in% new.nhc)
upd.ovid<-filter(upd.ovid, NHC %in% new.nhc) %>% mutate(NHC=as.character(NHC))
### !! Atención, esto cambia la base de datos:
sqlSave(dta, upd.ovid, tablename="OVID", append = T)

+ 1
- 0
ruta_database.R

@ -0,0 +1 @@
file<-"C:/Users/47926492N/OneDrive - IDIBELL - Institut d'Investigació Biomèdica de Bellvitge/RATG-PIULATS/OVARIO.accdb"

Loading…
Cancel
Save