From 3e6b97c5467301d1cef57c91864a461ec5fac3e9 Mon Sep 17 00:00:00 2001 From: marcelcosta Date: Fri, 10 Feb 2023 16:22:12 +0100 Subject: [PATCH] =?UTF-8?q?Correcci=C3=B3n=20errores=20conversi=C3=B3n=20e?= =?UTF-8?q?n=20an=C3=A1lisis.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- invivos/app.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/invivos/app.R b/invivos/app.R index 6335563..98c163b 100755 --- a/invivos/app.R +++ b/invivos/app.R @@ -355,7 +355,7 @@ server <- function(input, output) { observe({ if (!is.null(input$file_analy)){ table<-read.xlsx(input$file_analy$datapath, sheet = 1, check.names = F, sep.names = " ", detectDates = T) - if("ID animal" %in% colnames(table)){ + if("ID.animal" %in% colnames(table)){ table<-table %>% rename(Animal=`ID.animal`, Side=`ID.tumor`) table<-table %>% gather(DayPostInoc, Value, which(!is.na(as.numeric(colnames(table))))) %>% @@ -365,6 +365,7 @@ server <- function(input, output) { add_column(Weight="", .after="Group") %>% add_column(Volume="",Observations="") %>% relocate(Side, .after = "Group") + table$DayPostInoc<-as.numeric(table$DayPostInoc) } table$Date<-format(table$Date, format="%d/%m/%Y") @@ -374,6 +375,7 @@ server <- function(input, output) { 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) ## Autocompletado de grupo table_group<-merge( @@ -394,7 +396,7 @@ server <- function(input, output) { table$Group<-factor(table$Group, levels=levels) table<-filter(table, !is.na(Group)) } - + print(str(table)) analysis$taula<-table } })