#' Title
#'
#' @param bouts
#' @param listCalendarsAndBouts
#' @param progreso
#'
#' @return
#' @export
#'
basicSummaryOfBouts=function(bouts,generateCalendars,listCalendarsAndBouts,progreso=NULL){
if("data.frame" %in% class(bouts[[1]])){
if(!is.null(progreso)) progreso$tick()$print()
tmp=bind_rows(bouts);
if("idBIN" %in% names(tmp)) {idBIN= tmp$idBIN%>%first()} else{idBIN=""}
rm(tmp)
validcalendars=computeValidCalendars(bouts,generateCalendars,idBIN=idBIN)
# print(validcalendars)
bouts=bouts %>% append( map(validcalendars, ~ .x %>% select(from,to)))
listCalendarsAndBouts=map2(listCalendarsAndBouts,names(listCalendarsAndBouts),~append(.x,.y))
previo=summaryBoutsByCalendar(bouts,validcalendars,listCalendarsAndBouts)
if(ncol(previo)==0){message("\tSummary without columns. Nothing to get from this.")
return(NULL)
}
previo %>%
mutate(ratio=duration/durationRef) %>%
mutate(time=duration/seconds2Unit(variable))
} else {
progreso=dplyr::progress_estimated(length(bouts), min_time = 0)
map( bouts, ~ basicSummaryOfBouts(.x,generateCalendars,listCalendarsAndBouts,progreso)) %>% list2df("fileBIN")
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.