Transfer text between a character vector and the Windows clipboard in MS Windows (only).
1 2 3
logical: should the result be in human-readable form (the default) or raw numbers?
an integer giving the desired format.
should the value be returned as a raw vector rather than as a character vector?
a character vector or a raw vector.
The Windows clipboard offers data in a number of formats: see e.g. https://docs.microsoft.com/en-gb/windows/desktop/dataxchg/clipboard-formats.
The standard formats include
|CF_TEXT||1||Text in the machine's locale|
|CF_DIF||5||Data Interchange Format|
|CF_TIFF||6||Tagged-Image File Format|
|CF_OEMTEXT||7||Text in the OEM codepage|
|CF_UNICODETEXT||13||Text in Unicode (UCS-2)|
|CF_LOCALE||16||Locale for the text on the clipboard|
Applications normally make data available in one or more of these and
possibly additional private formats. Use
raw = TRUE to read binary
raw = FALSE (the default) for text formats. The
current codepage is used to convert text to Unicode text, and
information on that is contained in the
(Take care if you are running R in a different locale from Windows.)
writeClipboard function will write a character vector as
text or Unicode text with standard CR-LF line terminators. It will
copy a raw vector directly to the clipboard without any changes.
getClipboardFormats, a character or integer vector of
available formats, in numeric order. If non human-readable character
representation is known, the number is returned.
readClipboard, a character vector by default, a raw vector
NULL, if the format is
writeClipboard an invisible logical indicating success or
This is only available on Windows.
file which can be used to set up a connection to a clipboard.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.