lightswitch {vcr}R Documentation

Turn vcr on and off

Description

You can also control the default behaviour in a new session by setting the following environment variables before R starts:

Usage

turn_on()

turn_off(ignore_cassettes = FALSE)

turned_off(code, ignore_cassettes = FALSE)

turned_on()

skip_if_vcr_off()

Arguments

ignore_cassettes

(logical) Controls what happens when a cassette is inserted while vcr is turned off. If TRUE is passed, the cassette insertion will be ignored; otherwise an error will be raised. Default: FALSE

code

Any block of code to run, presumably an HTTP request.

Examples

# By default, vcr is turned on
turned_on()

# you can turn off for the rest of the session
turn_off()
turned_on()
# turn on again
turn_on()

# or just turn it on turn off temporarily
turned_off({
  # some HTTP requests here
  turned_on()
})

[Package vcr version 2.0.0 Index]