Skip to content
Snippets Groups Projects
Commit 5b9f2334 authored by Gael  MILLOT's avatar Gael MILLOT
Browse files

fun_slide() corrected

parent fa068c33
No related branches found
No related tags found
No related merge requests found
...@@ -3428,18 +3428,24 @@ fun_pack(req.package = "lubridate", lib.path = lib.path, load = TRUE) # load = T ...@@ -3428,18 +3428,24 @@ fun_pack(req.package = "lubridate", lib.path = lib.path, load = TRUE) # load = T
ini.date <- Sys.time() ini.date <- Sys.time()
ini.time <- as.numeric(ini.date) # time of process begin, converted into ini.time <- as.numeric(ini.date) # time of process begin, converted into
output <- NULL output <- NULL
print.count.loop <- 0
for(i4 in 1:length(x)){ for(i4 in 1:length(x)){
print.count.loop <- print.count.loop + 1
log <- get(left)(data, wind$left[x[i4]]) & get(right)(data, wind$right[x[i4]]) log <- get(left)(data, wind$left[x[i4]]) & get(right)(data, wind$right[x[i4]])
output <- c(output, eval(parse(text = paste0("FUN(data[log]", if( ! is.null(args)){paste0(", ", args)}, ")")))) output <- c(output, eval(parse(text = paste0("FUN(data[log]", if( ! is.null(args)){paste0(", ", args)}, ")"))))
if(verbose == TRUE){ if(verbose == TRUE){
if(any(i4 == seq(0, length(x), print.count))){ if(print.count.loop == print.count){
date.tempo <- Sys.time() print.count.loop <- 0
time.tempo <- as.numeric(date.tempo) tempo.time <- as.numeric(Sys.time())
lapse.tempo <- round((time.tempo - ini.time) / i4 * (length(x) - i4)) # tempo.lapse <- round(lubridate::seconds_to_period(tempo.time - ini.time))
lapse.finalend.tempo <- round((time.tempo - ini.time) / (i4 + length(x)) * (length(x) - i4)) # final.loop <- (tempo.time - ini.time) / i4 * length(x) # intra nb.compar loop lapse: time lapse / cycles done * cycles remaining
time.final.exp <- as.POSIXct(lapse.tempo, origin = date.tempo) final.exp <- as.POSIXct(final.loop, origin = ini.date)
time.finalend.exp <- as.POSIXct(lapse.finalend.tempo, origin = date.tempo) cat(paste0("\nIN PROCESS ", process.id, " | LOOP ", format(i4, big.mark=","), " / ", format(length(x), big.mark=","), " | TIME SPENT: ", tempo.lapse, " | EXPECTED END: ", final.exp))
print(paste0("Loop ", i4, " among ", length(x), " (", trunc(i4/ length(x) * 100), "% done) Time: ", Sys.time(), " Expected end: ", time.final.exp, " Final end: ", time.finalend.exp)) # do not display the correct time }
if(i4 == length(x)){
tempo.time <- as.numeric(Sys.time())
tempo.lapse <- round(lubridate::seconds_to_period(tempo.time - ini.time))
cat(paste0("\nPROCESS ", process.id, " ENDED | LOOP ", format(i4, big.mark=","), " / ", format(length(x), big.mark=","), " | TIME SPENT: ", tempo.lapse, "\n\n"))
} }
} }
} }
...@@ -7745,6 +7751,11 @@ return(output) # do not use cat() because the idea is to reuse the message ...@@ -7745,6 +7751,11 @@ return(output) # do not use cat() because the idea is to reuse the message
   
   
   
# add legend width from scatter (empty legend space notably). Ok with facet? # add legend width from scatter (empty legend space notably). Ok with facet?
# transfert the 2nd tick part to scatter # transfert the 2nd tick part to scatter
# improve grid -> put secondary grids. Then trasfert to scatter # improve grid -> put secondary grids. Then trasfert to scatter
...@@ -9541,6 +9552,10 @@ return(tempo <- output) ...@@ -9541,6 +9552,10 @@ return(tempo <- output)
   
   
   
# add return.ggplot = FALSE, from boxplot # add return.ggplot = FALSE, from boxplot
# add facet from boxplot if data1 is a dataframe or list of length 1 # add facet from boxplot if data1 is a dataframe or list of length 1
# error to fix: 1) accept integers as color, 2) fun_scale but xhuld be ok when importing the job from boxplot # error to fix: 1) accept integers as color, 2) fun_scale but xhuld be ok when importing the job from boxplot
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment