I try to use write_clip() with some string.
When I call read_clip(), I get different results without changing the clipboard value:
library("clipr")
#> Welcome to clipr. See ?write_clip for advisories on writing to the clipboard in R.
write_clip("plot(AirPassengers)", allow_non_interactive = TRUE)
read_clip(allow_non_interactive = TRUE)
#> [1] "plot(AirPassengers)" "爀役慤慴慢敳"
read_clip(allow_non_interactive = TRUE)
#> [1] "plot(AirPassengers)" "嘀翶"
read_clip(allow_non_interactive = TRUE)
#> [1] "plot(AirPassengers)"
read_clip(allow_non_interactive = TRUE)
#> [1] "plot(AirPassengers)" "爀浡≳嬺〳㤶ⱝ煚⩩退㈵㌷ㄹ〲昭㘰ⴶ搴愹愭㈰ⵢ㘵㔶〶昹ㄱ昵䔀)"
Also if I call utils::readClipboard(), I get the same results.
However, when I just paste the results with Ctrl + v (on Windows), every time I get plot(AirPassengers) with a new line (the expected result).
Also when I copy by hand and use read_clip(), I never get the additionnal character...
Thank you very much!
I try to use
write_clip()with some string.When I call
read_clip(), I get different results without changing the clipboard value:Also if I call
utils::readClipboard(), I get the same results.However, when I just paste the results with
Ctrl+v(on Windows), every time I getplot(AirPassengers)with a new line (the expected result).Also when I copy by hand and use
read_clip(), I never get the additionnal character...Thank you very much!