# RStudio

`httpgd` works with RStudio:

httpgd plot viewer in RStudio

## Usage

Open the plot viewer in the RStudio Viewer tab:

    library(httpgd)
    hgd()
    hgd_view()

Or open it in an external browser:

    hgd_browse()

## Troubleshooting

Resizing the Viewer tab while a plot exists in the Plots tab can cause RStudio to activate its own graphics device. When this happens, `httpgd` shows “Device inactive.” in the Viewer tab.

Check `dev.list()`, you will see an extra `RStudioGD` device:

    > dev.list()
    RStudioGD   agg_png    httpgd
            2         3         4

Close it with `dev.off()`:

    > dev.off()
    httpgd
         4

Now only the `httpgd` device remains. The issue should not reappear.