Learn R Programming

httpgd (version 1.3.1)

hgd_url: httpgd URL.

Description

Generate URLs to the plot viewer or to plot SVGs. This function will only work after starting a device with hgd().

Usage

hgd_url(
  endpoint = "live",
  which = dev.cur(),
  websockets = TRUE,
  width = -1,
  height = -1,
  renderer = NA,
  history = TRUE,
  host = NULL,
  port = NULL,
  explicit = FALSE
)

Value

URL.

Arguments

endpoint

API endpoint. The default, "live" is the HTML/JS plot viewer. Can be set to a numeric plot index or plot ID (see hgd_id()) to obtain the direct URL to the SVG.

which

Which device (ID).

websockets

Use websockets.

width

Width of the plot. (Only used when endpoint is "svg", or a plot index or ID.)

height

Height of the plot. (Only used when endpoint is "svg", or a plot index or ID.)

renderer

Renderer.

history

Should the plot history sidebar be visible.

host

Replaces hostname.

port

Replaces port.

explicit

Ads hgd={host}:{port} query parameter. Needed for host resolution in some editors.

Examples

Run this code
hgd()

plot(1, 1)
hgd_url(0)
hgd_url(hgd_id(), width = 800, height = 600)

dev.off()

Run the code above in your browser using DataLab