Browse Source

Cálculo de Volúmenes.

master
marcelcosta 1 year ago
parent
commit
11f3a57014
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      invivos/app.R

+ 7
- 0
invivos/app.R

@ -349,6 +349,13 @@ server <- function(input, output) {
if (!is.null(input$file_analy)){ if (!is.null(input$file_analy)){
table<-read.xlsx(input$file_analy$datapath, sheet = 1, check.names = F, sep.names = " ") table<-read.xlsx(input$file_analy$datapath, sheet = 1, check.names = F, sep.names = " ")
if ("sex" %in% colnames(table)){table<-select(table, -sex)} if ("sex" %in% colnames(table)){table<-select(table, -sex)}
table$Long<-gsub(",",".", table$Long)
table$Wide<-gsub(",",".", table$Wide)
for (i in 1:nrow(table)){
long<-as.numeric(strsplit(table[i,"Long"],"+", fixed = T)[[1]])
wide<-as.numeric(strsplit(table[i,"Wide"],"+", fixed = T)[[1]])
table[i,"Volume"]<-sum(sapply(1:length(long), function(x) (long[x]*wide[x]*wide[x])*(pi/6)))
}
analysis$taula<-table analysis$taula<-table
} }
}) })

Loading…
Cancel
Save