Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cute_little_R_functions
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gael MILLOT
cute_little_R_functions
Commits
5b9f2334
Commit
5b9f2334
authored
4 years ago
by
Gael MILLOT
Browse files
Options
Downloads
Patches
Plain Diff
fun_slide() corrected
parent
fa068c33
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cute_little_R_functions.R
+23
-8
23 additions, 8 deletions
cute_little_R_functions.R
cute_little_R_functions.docx
+0
-0
0 additions, 0 deletions
cute_little_R_functions.docx
with
23 additions
and
8 deletions
cute_little_R_functions.R
+
23
−
8
View file @
5b9f2334
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
cute_little_R_functions.docx
+
0
−
0
View file @
5b9f2334
No preview for this file type
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment