I have a client that is trying to use the reprex addin on RStudio Server. When we try to copy to the clipboard we get an error:
> reprex:::reprex_addin() ℹ Rendering reprex... Clipboard on X11 requires that the DISPLAY envvar be configured. x Unable to put result on the clipboard. How to get it: ● Capture what `reprex()` returns. ● Consult the output file. Control via `outfile` argument. ● Path to `outfile`: ◯ /tmp/Rtmpobt4Is/reprex75bfd2961ee/reprex_reprex.md Open the output file for manual copy? 1: yes 2: no Selection:
After investigating this for a bit, I now think that reprex uses the clipr package. And that I can reproduce this issue with just the clipr package:
library(clipr, lib.loc = "/usr/local/lib/R/site-library") Welcome to clipr. See ?write_clip for advisories on writing to the clipboard in R. > ?write_clip > clipr_available()  FALSE > text <- "Write to clipboard" > write_clip(text) Error: Clipboard on X11 requires that the DISPLAY envvar be configured.
I don't have prior experience working with shiny server. Does anyone have advice on how to solve this?
cc @jennybryan who I believe wrote the reprex package.