From fa2c7846029edb9f898043bae36ff35e83545a2b Mon Sep 17 00:00:00 2001 From: marcelcosta Date: Fri, 10 Feb 2023 16:04:43 +0100 Subject: [PATCH] =?UTF-8?q?En=20an=C3=A1lisis,=20conversi=C3=B3n=20de=20fo?= =?UTF-8?q?rmato=20antiguo=20a=20moderno.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- invivos/app.R | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/invivos/app.R b/invivos/app.R index 85022d9..6335563 100755 --- a/invivos/app.R +++ b/invivos/app.R @@ -355,6 +355,18 @@ 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)){ + table<-table %>% + rename(Animal=`ID.animal`, Side=`ID.tumor`) + table<-table %>% gather(DayPostInoc, Value, which(!is.na(as.numeric(colnames(table))))) %>% + relocate(DayPostInoc, .before = Group) %>% spread(DPV, Value) %>% + rename(Long=Major, Wide=Minor) %>% + add_column(Date="", .after = "Animal") %>% + add_column(Weight="", .after="Group") %>% + add_column(Volume="",Observations="") %>% + relocate(Side, .after = "Group") + } + table$Date<-format(table$Date, format="%d/%m/%Y") if ("sex" %in% colnames(table)){table<-select(table, -sex)} for (i in 1:nrow(table)){