https://github.com/dgkf/rec
Record your R session and play it back
https://github.com/dgkf/rec
Last synced: 2 months ago
JSON representation
Record your R session and play it back
- Host: GitHub
- URL: https://github.com/dgkf/rec
- Owner: dgkf
- Created: 2021-11-02T14:34:54.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-09T13:20:08.000Z (over 1 year ago)
- Last Synced: 2024-12-04T05:39:55.462Z (3 months ago)
- Language: R
- Size: 11.7 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - dgkf/rec - Record your R session and play it back (R)
README
# :red_circle: rec
Record and play back your R
> :warning: the features here are almost entirely covered by
> [asciicast](https://github.com/r-lib/asciicast), a more mature
> and better maintained project :warning:`rec` captures code evaluation and output, trying to preserve the R objects,
console output and conditions (messages, warnings and errors) emitted during
evaluation.## Quick Start
`rec` operates in one of two ways, either recording an expression's evaluation,
or recording the top level interactive console. In both, cases, you can use
the singular interface, `rec()`. Once you've recorded evaluation, you
can also play it back](https://asciinema.org/a/MvqJkDVvH4gTBz618RCU58l0m)
### Record your console
Recording your console is started and stopped by running `rec()`. While
recording, you'll see a ":red_circle:" in front of your command prompt,
indicating that you're in a recording session.```r
rec()
print(1:3)
# [1] 1 2 3
rec() # stop recordingplay()
# print(1:3)
# [1] 1 2 3
```### Record expression evaluation
Alternatively, you may want to capture evaluation in the background. This can be
A helpful alternative to `capture.output`, for situations where you want to
capture messages, but want to restructure the formatting or operate```r
recording <- rec(print(1:3))
# [1] 1 2 3play(recording)
# print(1:3)
# [1] 1 2 3
```