|
|
@ -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) |
|
|
|