Skip to content

Instantly share code, notes, and snippets.

View BlasBenito's full-sized avatar

Blas Benito BlasBenito

View GitHub Profile
@toebR
toebR / eco_river_palette.md
Last active August 20, 2020 14:37
6 color green-turquoise palette for discrete variables

#By Tobias Stalder #August 2020

library(scales)

eco_river_pal <- c("#d0ece7", "#a9dfbf", "#73c6b6", "#27ae60", "#117a65",

@kvasilopoulos
kvasilopoulos / progressbar_doParallel_foreach.R
Last active April 10, 2024 08:27
How to include progressbar with doParallel (previously done only with the doSNOW-package) and foreach loop. Note, that you can easily wrap this into a function.
library(doParallel)
# Choose number of iterations
n <- 100
# Progress combine function
f <- function(iterator){
pb <- txtProgressBar(min = 1, max = iterator - 1, style = 3)
count <- 0
function(...) {