-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use clipr::dr_clipr() #105
Comments
@mdlincoln What would be the most official way for me to delegate messaging about this to clipr? I already use |
Hm, good question. Possible solution: Add a |
Here in reprex, I would handle with a closure so that I only message upon the first attempt to use the clipboard. Maybe you need a clipr "doctor" function that either emits an "all clear" or OS-appropriate advice on how to make the clipboard available? For now I can presumably catch the error from |
That does sound more elegant. I'll have to read up a bit on how to build that in to clipr, and will keep you posted. |
I think this is more elaborate than you need, but something along the lines of https://github.com/krlmlr/here/blob/93593ee1e04d456d33199795c1d6491bd9b84164/R/here.R#L25-L54 You have all the ingredients (checking availability and suggesting remedies), just not packaged in a doctor function.
|
Just as a side: my idea was more humbly to just include a line warning of this potential problem in the README.md. Obviously, the solution that you are building is much stronger. |
Indeed @gvdr, but your issue definitely highlights something that clipr should handle more transparently, especially since many people will be using clipr when it's called by other packages like reprex. |
I'm adding one bullet to my message and will upgrade the approach when/if
|
I actually have some time to look at this over the next day - I'll keep you updated @jennybc! |
OK, the latest build of clipr now has a |
I'm going to reopen this so I don't forget to test drive |
@jennybc I totally forgot about minting a new CRAN release =_= but I will by the end of this week! Let me know if you spot any issues with |
OK. I don't think I've given it a whirl yet but will try do to do! reprex is also basically ready for a new release. I am waiting on a few dependencies to appear or update on CRAN. |
Clipboard is not generally available on Linux. Following the minimum example provided (copying to clipboard
y <- 1:4
) I got:Clipr provides also a solution:
And in fact, having installed xclip, everything seems to be working fine. 👍
However, the solution is maybe not so straightforward to find? I'd suggest to put a line somewhere suggesting Linux users to install xclip if they want to run reprex.
The text was updated successfully, but these errors were encountered: