read_clipboard: Read from Windows/OSX clipboard

Description Usage Arguments Note Author(s) Examples

Description

Thin wrapper for reading from windows/OSX clipboards with the most-used defaults. The function first reads in the lines, checks if the delimiter is present in the lines and then converts it to a data.frame.

Usage

1
2
3
read_clipboard(delim = "\t", ...)

from_clipboard(delim = "\t", ...)

Arguments

delim

The delimiter for columns.

...

Further arguments passed to read_delim.

Note

This function only works on Windows or OSX, and the data-size cannot exceed 128kb in Windows.

Author(s)

Kristian D. Olsen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# Only works on Windows and OSX
df <- data.frame("String" = c("A", "B"), "Int" = c(1:2L), "Percent" = c(0.5, 0.75))
to_clipboard(df)
x <- from_clipboard()

# All equal - except attributes
# (readr attaches attr "problems")
all.equal(x, df, check.attributes = FALSE)

## End(Not run)

itsdalmo/seamless documentation built on May 18, 2019, 7:11 a.m.