Learn R Programming

httpgd (version 1.1.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,
  history = TRUE
)

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.)

history

Should the plot history sidebar be visible.

Value

URL.

Examples

Run this code
# NOT RUN {
hgd()
my_url <- hgd_url()
hgd_url(0)
hgd_url(plot_id(), width = 800, height = 600)

dev.off()
# }

Run the code above in your browser using DataLab