Browse Source

Añadido Abs como opción para medidas de IVIS en la pestaña Análisis.

master
marcelcosta 1 month ago
parent
commit
1237794f62
1 changed files with 11 additions and 5 deletions
  1. +11
    -5
      invivos/app.R

+ 11
- 5
invivos/app.R

@ -121,12 +121,17 @@ server <- function(input, output) {
} }
table$Date<-format(table$Date, format="%d/%m/%Y") table$Date<-format(table$Date, format="%d/%m/%Y")
if ("sex" %in% colnames(table)){table<-select(table, -sex)} if ("sex" %in% colnames(table)){table<-select(table, -sex)}
for (i in 1:nrow(table)){
long<-as.numeric(gsub(",",".",strsplit(as.character(table[i,"Long"]),"+", fixed = T)[[1]]))
wide<-as.numeric(gsub(",",".",strsplit(as.character(table[i,"Wide"]),"+", fixed = T)[[1]]))
table[i,"Volume"]<-sum(sapply(1:length(long), function(x) (long[x]*wide[x]*wide[x])*(pi/6)))
if ("Abs" %in% colnames(table)){
table<-rename(table, "Volume"="Abs")
}else{
for (i in 1:nrow(table)){
long<-as.numeric(gsub(",",".",strsplit(as.character(table[i,"Long"]),"+", fixed = T)[[1]]))
wide<-as.numeric(gsub(",",".",strsplit(as.character(table[i,"Wide"]),"+", fixed = T)[[1]]))
table[i,"Volume"]<-sum(sapply(1:length(long), function(x) (long[x]*wide[x]*wide[x])*(pi/6)))
}
table$Volume<-as.numeric(table$Volume)
} }
table$Volume<-as.numeric(table$Volume)
if ("Cage" %in% colnames(table)){ if ("Cage" %in% colnames(table)){
table$Animal<-paste0(table$Cage, table$Animal) table$Animal<-paste0(table$Cage, table$Animal)
table<-table[,-which(colnames(table) == "Cage")] table<-table[,-which(colnames(table) == "Cage")]
@ -194,6 +199,7 @@ server <- function(input, output) {
grafic<-eventReactive(input$goButton,{ grafic<-eventReactive(input$goButton,{
df<-dades$taula %>% filter(DayPostInoc == input$day_vol) df<-dades$taula %>% filter(DayPostInoc == input$day_vol)
df<-df[!is.na(df$Volume),] df<-df[!is.na(df$Volume),]
print(df)
up_cuttof<-input$upcut up_cuttof<-input$upcut
low_cuttof<-input$lowcut low_cuttof<-input$lowcut

Loading…
Cancel
Save