Browse Source

Corrección bug operados.

master
marcelcosta 11 months ago
parent
commit
d9a5689c99
1 changed files with 9 additions and 8 deletions
  1. +9
    -8
      invivos/app.R

+ 9
- 8
invivos/app.R

@ -439,6 +439,7 @@ server <- function(input, output) {
table %>% group_by(Group, DayPostInoc, Side) %>% count() %>% spread(DayPostInoc, n) table %>% group_by(Group, DayPostInoc, Side) %>% count() %>% spread(DayPostInoc, n)
} }
}) })
output$cin_group<-renderPlot({ output$cin_group<-renderPlot({
if (!is.null(input$file_analy) & !is.null(analysis$taula)){ if (!is.null(input$file_analy) & !is.null(analysis$taula)){
observeEvent(analysis$taula, {}) observeEvent(analysis$taula, {})
@ -469,7 +470,7 @@ server <- function(input, output) {
deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>% deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>%
pull(Animal) pull(Animal)
print(deadmice) print(deadmice)
if (input$operated == TRUE){
if (input$operated == TRUE & nrow(firstoper) > 0){
for (i in 1:nrow(firstoper)){ for (i in 1:nrow(firstoper)){
table<-table %>% filter(DayPostInoc < firstoper$FirstOper[i] | Side != firstoper$Side[i]) table<-table %>% filter(DayPostInoc < firstoper$FirstOper[i] | Side != firstoper$Side[i])
} }
@ -478,7 +479,7 @@ server <- function(input, output) {
table<-table %>% filter(!Animal %in% deadmice) table<-table %>% filter(!Animal %in% deadmice)
} }
} }
ggplot(table, aes(DayPostInoc, Volume, color=Group, group=Group))+ ggplot(table, aes(DayPostInoc, Volume, color=Group, group=Group))+
geom_errorbar(stat="summary", width=0.05)+ geom_errorbar(stat="summary", width=0.05)+
geom_line(stat="summary")+ geom_line(stat="summary")+
@ -487,14 +488,14 @@ server <- function(input, output) {
labs(x="Days after tumor inoculation")+ labs(x="Days after tumor inoculation")+
scale_y_continuous(expand = expansion(mult = c(0,0.05)))+ scale_y_continuous(expand = expansion(mult = c(0,0.05)))+
scale_x_continuous(expand = expansion(mult = c(0,0.05)), limits = c(0, (round(max(table$DayPostInoc) / 5)+1)*5))+ scale_x_continuous(expand = expansion(mult = c(0,0.05)), limits = c(0, (round(max(table$DayPostInoc) / 5)+1)*5))+
theme_bw()
theme_bw()
}else{ }else{
firstoper<- filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "*") %>% firstoper<- filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "*") %>%
pull(DayPostInoc) %>% min(na.rm = T) pull(DayPostInoc) %>% min(na.rm = T)
print(firstoper) print(firstoper)
if (input$operated == TRUE){
if (input$operated == TRUE & nrow(firstoper) > 0){
table<-table %>% filter(DayPostInoc < firstoper) table<-table %>% filter(DayPostInoc < firstoper)
}else{ }else{
deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>% deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>%
@ -542,7 +543,7 @@ server <- function(input, output) {
firstoper<- filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "*") %>% firstoper<- filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "*") %>%
select(DayPostInoc, Side) %>% unique() %>% select(DayPostInoc, Side) %>% unique() %>%
group_by(Side) %>% summarise(FirstOper=min(DayPostInoc)) group_by(Side) %>% summarise(FirstOper=min(DayPostInoc))
if (input$operated == TRUE){
if (input$operated == TRUE & nrow(firstoper) > 0){
for (i in 1:nrow(firstoper)){ for (i in 1:nrow(firstoper)){
table<-table %>% filter(DayPostInoc < firstoper$FirstOper[i] | Side != firstoper$Side[i]) table<-table %>% filter(DayPostInoc < firstoper$FirstOper[i] | Side != firstoper$Side[i])
} }
@ -567,7 +568,7 @@ server <- function(input, output) {
pull(DayPostInoc) %>% min(na.rm = T) pull(DayPostInoc) %>% min(na.rm = T)
print(firstoper) print(firstoper)
if (input$operated == TRUE){
if (input$operated == TRUE & nrow(firstoper) > 0){
table<-table %>% filter(DayPostInoc < firstoper) table<-table %>% filter(DayPostInoc < firstoper)
}else{ }else{
deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>% deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>%
@ -598,7 +599,7 @@ server <- function(input, output) {
firstoper<- filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "*") %>% firstoper<- filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "*") %>%
select(DayPostInoc, Side) %>% unique() %>% select(DayPostInoc, Side) %>% unique() %>%
group_by(Side) %>% summarise(FirstOper=min(DayPostInoc)) group_by(Side) %>% summarise(FirstOper=min(DayPostInoc))
if (input$operated == TRUE){
if (input$operated == TRUE & nrow(firstoper) > 0){
for (i in 1:nrow(firstoper)){ for (i in 1:nrow(firstoper)){
table<-table %>% filter(DayPostInoc < firstoper$FirstOper[i] | Side != firstoper$Side[i]) table<-table %>% filter(DayPostInoc < firstoper$FirstOper[i] | Side != firstoper$Side[i])
} }
@ -639,7 +640,7 @@ server <- function(input, output) {
pull(DayPostInoc) %>% min(na.rm = T) pull(DayPostInoc) %>% min(na.rm = T)
print(firstoper) print(firstoper)
if (input$operated == TRUE){
if (input$operated == TRUE & nrow(firstoper) > 0){
table<-table %>% filter(DayPostInoc < firstoper) table<-table %>% filter(DayPostInoc < firstoper)
}else{ }else{
deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>% deadmice<-filter(table, !is.na(substr(Observations,1,1)) & substr(Observations,1,1) == "+") %>%

Loading…
Cancel
Save