Description Usage Arguments Examples
View source: R/sendeR_lapply.R
Function is a wrapper for standard lapply
. The
sendeR_lapply
after performing the regular lapply
executes
client
argument's send_message
method thus notifying
the user that lapply
has finished.
1 | sendeR_lapply(client, X, FUN, ...)
|
client |
the sendeR client which will send a message at end of the
regular |
X |
a vector (atomic or list) to apply |
FUN |
the function to be applied to each element of |
... |
named arguments will be passed to the |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Using regular client
client <- client_telegram("my_token")
## Not run:
my_func <- function(x, text) { print(paste(text, x)); Sys.sleep(x) }
sendeR_lapply(client, 1:10, my_func, "Sleeping:", destination = 12345,
message = "sendeR_lapply done!")
## End(Not run)
# Using client with set fields
client_with_fields <- set_fields(client, message = "sendeR_lapply is done!",
destination = 12345)
## Not run:
sendeR_lapply(client_with_fields, 1:10, my_func, "Sys.sleep:")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.