All Projects → mdlincoln → Clipr

mdlincoln / Clipr

R functions for reading and writing from the system clipboard

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Clipr

Javascript For R
JavaScript for R CRC Book
Stars: ✭ 98 (-12.5%)
Mutual labels:  rstats
Markor
Text editor - Notes & ToDo (for Android) - Markdown, todo.txt, plaintext, math, ..
Stars: ✭ 1,394 (+1144.64%)
Mutual labels:  clipboard
Anicon
Animated icons for R markdown and Shiny apps
Stars: ✭ 109 (-2.68%)
Mutual labels:  rstats
Ahk Rare
My collection of rare and maybe very useful functions
Stars: ✭ 101 (-9.82%)
Mutual labels:  clipboard
Repo 2016
R, Python and Mathematica Codes in Machine Learning, Deep Learning, Artificial Intelligence, NLP and Geolocation
Stars: ✭ 103 (-8.04%)
Mutual labels:  rstats
Dev guide
rOpenSci Packages: Development, Maintenance, and Peer Review
Stars: ✭ 106 (-5.36%)
Mutual labels:  rstats
Monkeylearn
⛔️ ARCHIVED ⛔️ 🐒 R package for text analysis with Monkeylearn 🐒
Stars: ✭ 95 (-15.18%)
Mutual labels:  rstats
Starters
R Package 📦 for initializing projects for various R activities 🔩
Stars: ✭ 111 (-0.89%)
Mutual labels:  rstats
Particles
A particle simulation engine based on a port of d3-force
Stars: ✭ 104 (-7.14%)
Mutual labels:  rstats
Pkgverse
📦🔭🌠 Create your own universe of packages à la tidyverse
Stars: ✭ 108 (-3.57%)
Mutual labels:  rstats
Rorcid
A programmatic interface the Orcid.org API
Stars: ✭ 101 (-9.82%)
Mutual labels:  rstats
Fastrtext
R wrapper for fastText
Stars: ✭ 103 (-8.04%)
Mutual labels:  rstats
Rtemis
Advanced Machine Learning and Visualization
Stars: ✭ 107 (-4.46%)
Mutual labels:  rstats
Shinycustomloader
Add a custom loader for R shiny
Stars: ✭ 97 (-13.39%)
Mutual labels:  rstats
Shinyapps links
A collection of Shiny applications (links shared on Twitter)
Stars: ✭ 109 (-2.68%)
Mutual labels:  rstats
Ggbernie
A ggplot2 geom for adding Bernie Sanders to ggplot2
Stars: ✭ 96 (-14.29%)
Mutual labels:  rstats
Inferno
🔥 Modern command line tool for malware creation on Windows
Stars: ✭ 105 (-6.25%)
Mutual labels:  clipboard
Ssh
Native SSH client in R based on libssh
Stars: ✭ 111 (-0.89%)
Mutual labels:  rstats
Countdown
⏲ countdown timer for R Markdown slides and HTML docs
Stars: ✭ 110 (-1.79%)
Mutual labels:  rstats
Monetdblite
MonetDB reconfigured as a library
Stars: ✭ 107 (-4.46%)
Mutual labels:  rstats

clipr

CRAN status. Downloads, grand total Travis-CI Build Status AppVeyor Build Status Coverage Status

Simple utility functions to read and write from the system clipboards of Windows, OS X, and Unix-like systems (which require either xclip or xsel.)

Installation

Install from CRAN

install.packages("clipr")

Or try the development version

devtools::install_github("mdlincoln/clipr")

Usage

library("clipr")
#> Welcome to clipr. See ?write_clip for advisories on writing to the clipboard in R.

cb <- read_clip()

clipr is pipe-friendly, and will default to returning the same object that was passed in.

res <- write_clip(c("Text", "for", "clipboard"))
res
#> [1] "Text"      "for"       "clipboard"

To capture the string that clipr writes to the clipboard, specify return_new = TRUE. Character vectors with length > 1 will be collapsed with system-appropriate line breaks, unless otherwise specified

cb <- write_clip(c("Text", "for", "clipboard"), return_new = TRUE)
cb
#> [1] "Text\nfor\nclipboard"

cb <- write_clip(c("Text", "for", "clipboard"), breaks = ", ", return_new = TRUE)
cb
#> [1] "Text, for, clipboard"

write_clip also tries to intelligently handle data.frames and matrices, rendering them with write.table so that they can be pasted into a spreadsheet like Excel.

tbl <- data.frame(a = c(1, 2, 3), b = c(4, 5, 6))
cb <- write_clip(tbl, return_new = TRUE)
cb
#> [1] "a\tb\n1\t4\n2\t5\n3\t6"

read_clip_tbl will try to parse clipboard contents from spreadsheets into data frames directly.

Developing with clipr

See the “Developing with clipr” vignette included with this package for advisories on writing code that calls clipr functions.

Nice uses of clipr

(a non-comprehensive list)

  1. reprex by @jennybc takes R code on the clipboard and renders a reproducible example from it, ready to then paste on to GitHub, Stack Overflow, or the like.
  2. datapasta by @milesmcbain eases the copying and pasting of R objects in and out of different sources (Excel, Google Sheets).

Matthew Lincoln

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].