Browse Source

"correct template"

master
Costa 4 years ago
parent
commit
0f4791f814
1 changed files with 8 additions and 3 deletions
  1. +8
    -3
      invivos/app.R

+ 8
- 3
invivos/app.R

@ -178,10 +178,15 @@ server <- function(input, output) {
dtemplate<-dcast(template, MouseID+group+DPV~Timepoint)
dtemplate<-dtemplate[mixedorder(as.character(dtemplate$MouseID)),]
}
dtemplate[,4:ncol(dtemplate)]<-""
dtemplate<-dtemplate %>% add_column(.after="MouseID", "ID tumor"=dtemplate$MouseID)%>% rename(`ID animal`=MouseID)
dtemplate["ID tumor"]<-gsub("[[:digit:]]","",dtemplate$`ID tumor`)
dtemplate["ID animal"]<-gsub("[LR]","",dtemplate$`ID animal`)
dtemplate[,5:ncol(dtemplate)]<-""
}else{
template<-expand.grid(LETTERS[1:ncages], 1:5, id_tumors, timepoint)
colnames(template)<-c("Cage", "ID animal", "ID tumor", "Timepoint")
template<-expand.grid(LETTERS[1:ncages], 1:5, id_tumors, timepoint)[,-2]
colnames(template)<-c("Cage", "ID tumor", "Timepoint")
nids<-length(id_tumors)*length(timepoint)
template[order(template$Cage),"ID animal"]<-rep(1:(nrow(template)/(nids)), each=nids)
template<-template[order(template$Timepoint, template$Cage, template$`ID animal`),]
template["Group"]<-""
if (input$measure_sys == "L-W-D"){

Loading…
Cancel
Save