Compare commits

..

3 Commits

Author SHA1 Message Date
Costa f53d7b564c Añado que muestre una tabla al final con todos los volúmenes. 2022-02-22 14:51:34 +01:00
Costa dfc88324dc Cambios en el upcut y en la representación de puntos de corte. 2022-02-22 14:48:38 +01:00
Costa ab76b7eb22 Corrección duplicados. 2022-02-22 14:41:15 +01:00
+13 -5
View File
@@ -34,7 +34,8 @@ ui <- fluidPage(
mainPanel(
plotOutput("firstPlot"),
plotOutput("distPlot"),
tableOutput("distTable")
tableOutput("distTable"),
tableOutput("distTableAll")
)
),
tabPanel("Análisis",
@@ -107,7 +108,7 @@ server <- function(input, output) {
output$firstPlot <- renderPlot({
observeEvent(dades$taula, {})
if (!is.null(dades$taula)){
ggplot(dades$taula, aes(x="1", y=Volume))+geom_quasirandom(width=0.2)
ggplot(dades$taula, aes(x="1", y=Volume))+geom_hline(yintercept = c(input$lowcut, input$upcut), color="red")+geom_quasirandom(width=0.2)
}
})
@@ -125,7 +126,7 @@ server <- function(input, output) {
})
output$upcut<-renderUI({
if (!is.null(dades$taula)){
cut.max<-round(max(dades$taula$Volume, na.rm = T), 2)
cut.max<-round(max(dades$taula$Volume, na.rm = T), 2)+0.01
step<-round(max(dades$taula$Volume, na.rm = T)/20, 2)
sliderInput("upcut", "Corte superior", min=0, max=cut.max, step=step, value=cut.max)
}
@@ -146,7 +147,7 @@ server <- function(input, output) {
up_cuttof<-input$upcut
low_cuttof<-input$lowcut
print(up_cuttof)
df<-df[df$Volume <= up_cuttof & df$Volume >= low_cuttof,]
df<-df[df$Volume < up_cuttof & df$Volume >= low_cuttof,]
# df["Mouse"]<-gsub("[a-zA-Z]", "", df$MouseID)
@@ -187,7 +188,7 @@ server <- function(input, output) {
if ("Group" %in% colnames(df_def)){
df_def<-df_def %>% select(-"Group")
}
df_def<-merge(dades$taula %>% select(-Group), df_def[,c("ID animal", "group")], all=T) %>% select(c(`ID animal`, `ID tumor`, Volume, Cage, Major, Minor, group))
df_def<-merge(dades$taula %>% select(-Group), df_def[,c("ID animal", "group")] %>% unique, all=T, by="ID animal") %>% select(c(`ID animal`, `ID tumor`, Volume, Cage, Major, Minor, group))
df_def[!paste0(df_def$`ID animal`, df_def$`ID tumor`) %in% paste0(df$`ID animal`, df$`ID tumor`),"group"]<-NA
dades$db<-df_def
@@ -214,6 +215,13 @@ server <- function(input, output) {
df_sum
}
})
output$distTableAll <- renderTable({
observeEvent(dades$db, {})
if (!is.null(dades$db)){
df<-dades$db
df %>% arrange(group)
}
})
output$downloadData <- downloadHandler(