sendeR_txtProgressBar: sendeR txtProgressBar

Description Usage Arguments Details Value See Also Examples

View source: R/sendeR_txtProgressBar.R

Description

This function is a wrapper for txtProgressBar. In addition to standard txtProgressBar functionality this function will send message using send_message method of the client argument. Parameters other than client and ... have the same use-case as in the txtProgressBar (description of these parameters was taken from txtProgressBar documentation).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sendeR_txtProgressBar(
  client,
  min = 0,
  max = 1,
  initial = 0,
  char = "=",
  width = NA,
  title,
  label,
  style = 1,
  file = "",
  ...
)

Arguments

client

the client which will send the message.

min, max

(finite) numeric values for the extremes of the progress bar. Must have min < max.

initial

initial or new value for the progress bar. See ‘Details’ in txtProgressBar for what happens with invalid values.

char

the character (or character string) to form the progress bar.

width

the width of the progress bar, as a multiple of the width of char. If NA, the default, the number of characters is that which fits into getOption("width").

title, label

ignored, for compatibility with other progress bars.

style

the ‘style’ of the bar – see ‘Details’ in txtProgressBar.

file

an open connection object or "" which indicates the console: stderr() might be useful here.

...

additional parameters to be passed to the send_message method (including message and destination).

Details

Note: If the client has no fields set then the message and destination have to be passed through the ellipsis (...).

Value

A progress bar object on which every method normally used on txtProgressBar can be used.

See Also

getTxtProgressBar, setTxtProgressBar

Examples

1
2
3
4
5
6
7
8
9
client <- client_slack("my_webhook")
pb <- sendeR_txtProgressBar(client, message = "Progress bar has finished!")
## Not run: 
     for (i in 1:10) {
         Sys.sleep(0.5)
         setTxtProgressBar(pb, i / 10)
     }

## End(Not run)

tmakowski/sendeR documentation built on June 27, 2020, 9 p.m.