Skip to content

Commit

Permalink
Add README, #3
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Apr 7, 2015
1 parent d76aef3 commit a774ca9
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

# progress

> Progress bar in your R terminal
An R package to show ASCII progress bars. Heavily influenced by
the https://github.com/tj/node-progress JavaScript project.

## Installation

```r
devtools::install_github("gaborcsardi/progress")
```

## Usage

Use the `progress_bar` R6 class:

```r
pb <- progress_bar$new(total = 100)
for (i in 1:100) {
pb$tick()
Sys.sleep(1 / 100)
}
```

```
[==========================================================-------------] 81%
```

Custom format, with estimated time of completion:

```r
pb <- progress_bar$new(
format = " downloading [:bar] :percent eta: :eta",
total = 100, clear = FALSE, width= 60)
for (i in 1:100) {
pb$tick()
Sys.sleep(1 / 100)
}
```

```
downloading [========----------------------] 28% eta: 1s
```

With elapsed time:

```r
pb <- progress_bar$new(
format = " downloading [:bar] :percent in :elapsed",
total = 100, clear = FALSE, width= 60)
for (i in 1:100) {
pb$tick()
Sys.sleep(1 / 100)
}
```

```
downloading [==========================------] 80% in 1s
```

See the manual for details and other options.

## License

MIT

0 comments on commit a774ca9

Please sign in to comment.