Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f53d7b564c | |||
| dfc88324dc | |||
| ab76b7eb22 |
+13
-5
@@ -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(
|
||||
|
||||
|
||||
Reference in New Issue
Block a user