Learn R Programming

photon (version 0.7.4)

with_photon: Local photon instances

Description

Evaluate R code with a photon instance without changing the active photon mount.

Usage

with_photon(photon, code)

Value

The results of the evaluation of the code argument.

Arguments

photon

An object of class photon that is temporarily mounted to the session.

code

Code to execute in the temporary environment.

Examples

Run this code
# Get a public instance
pub_photon <- new_photon()

# Mount a custom instance
new_photon(url = "https://localhost:8001/")

# Geocode with the public instance only once
with_photon(pub_photon, geocode("Rutland"))

# The custom instance is still mounted
get_instance()

Run the code above in your browser using DataLab