# NOT RUN {
# Function that takes a string and pastes two other strings
# a its beginning and end respectivelly
pad <- function(str, b = "", a = "") { paste0(b, str, a) }
# Create wrapped version of pad() that executes over 4 cores,
# captures errors, and prints its current iteration with a
# probability of 50%
new_pad <- carefully(pad, p = 0.5, cores = 4)
# Execute new_pad() with some sample data
new_pad(c("asdf", "poiu", "qwer"), b = "0", a = "1")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab