EVOLUTION-MANAGER
Edit File: write_clip.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Write clipboard</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for write_clip {clipr}"><tr><td>write_clip {clipr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Write clipboard</h2> <h3>Description</h3> <p>Write a character vector to the system clipboard </p> <h3>Usage</h3> <pre> write_clip(content, object_type = c("auto", "character", "table"), breaks = NULL, eos = NULL, return_new = FALSE, allow_non_interactive = Sys.getenv("CLIPR_ALLOW", interactive()), ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>content</code></td> <td> <p>An object to be written to the system clipboard.</p> </td></tr> <tr valign="top"><td><code>object_type</code></td> <td> <p><code><a href="write_clip.html">write_clip()</a></code> tries to be smart about writing objects in a useful manner. If passed a data.frame or matrix, it will format it using <code><a href="../../utils/html/write.table.html">write.table()</a></code> for pasting into an external spreadsheet program. It will otherwise coerce the object to a character vector. <code>auto</code> will check the object type, otherwise <code>table</code> or <code>character</code> can be explicitly specified.</p> </td></tr> <tr valign="top"><td><code>breaks</code></td> <td> <p>The separator to be used between each element of the character vector being written. <code>NULL</code> defaults to writing system-specific line breaks between each element of a character vector, or each row of a table.</p> </td></tr> <tr valign="top"><td><code>eos</code></td> <td> <p>The terminator to be written after each string, followed by an ASCII <code>nul</code>. Defaults to no terminator character, indicated by <code>NULL</code>.</p> </td></tr> <tr valign="top"><td><code>return_new</code></td> <td> <p>If true, returns the rendered string; if false, returns the original object</p> </td></tr> <tr valign="top"><td><code>allow_non_interactive</code></td> <td> <p>By default, clipr will throw an error if run in a non-interactive session. Set the environment variable <code>CLIPR_ALLOW=TRUE</code> in order to override this behavior.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Custom options to be passed to <code><a href="../../utils/html/write.table.html">write.table()</a></code> (if <code>x</code> is a table-like). Defaults to sane line-break and tab standards based on the operating system. By default, this will use <code>col.names = TRUE</code> if the table object has column names, and <code>row.names = TRUE</code> if the object has row names other than <code>c("1", "2", "3"...)</code>. Override these defaults by passing arguments here.</p> </td></tr> </table> <h3>Value</h3> <p>Invisibly returns the original object </p> <h3>Note</h3> <p>On X11 systems, <code><a href="write_clip.html">write_clip()</a></code> will cause either xclip (preferred) or xsel to be called. Be aware that, by design, these processes will fork into the background. They will run until the next paste event, when they will then exit silently. (See the man pages for <a href="https://linux.die.net/man/1/xclip">xclip</a> and <a href="http://www.vergenet.net/~conrad/software/xsel/xsel.1x.html#notes">xsel</a> for more on their behaviors.) However, this means that even if you terminate your R session after running <code><a href="write_clip.html">write_clip()</a></code>, those processes will continue until you access the clipboard via another program. This may be expected behavior for interactive use, but is generally undesirable for non-interactive use. For this reason you must not run <code><a href="write_clip.html">write_clip()</a></code> on CRAN, as the nature of xsel <a href="https://github.com/mdlincoln/clipr/issues/38">has caused issues in the past</a>. </p> <p>Call <code><a href="clipr_available.html">clipr_available()</a></code> to safely check whether the clipboard is readable and writable. </p> <h3>Examples</h3> <pre> ## Not run: text <- "Write to clipboard" write_clip(text) multiline <- c("Write", "to", "clipboard") write_clip(multiline) # Write # to # clipboard write_clip(multiline, breaks = ",") # write,to,clipboard tbl <- data.frame(a=c(1,2,3), b=c(4,5,6)) write_clip(tbl) ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>clipr</em> version 0.7.0 <a href="00Index.html">Index</a>]</div> </body></html>