# Will only run on windows
if (Sys.info()[["sysname"]] == "Windows") {
foo <- function(x) {
write_clipboard(x)
y <- read_clipboard()
res <- all.equal(x, y)
if (isTRUE(res)) return("All equal")
print(x)
print(y)
}
foo(1:4)
foo(seq(-1, 1, .02))
foo(Sys.Date() + 1:4)
# May have some rounding issues
x <- "0.316362437326461129"
write_clipboard(x)
res <- as.character(read_clipboard())
all.equal(x, res)
x; res
}
Run the code above in your browser using DataLab