diff --git a/.Rbuildignore b/.Rbuildignore index 91114bf..aed25d6 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,2 +1,3 @@ ^.*\.Rproj$ ^\.Rproj\.user$ +cran-comments.md diff --git a/DESCRIPTION b/DESCRIPTION index cb0553e..ccdab85 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,11 +1,14 @@ Package: clipr Type: Package Title: Read and Write from the System Clipboard -Version: 0.0.0.9000 +Version: 0.1.0 Date: 2015-08-27 -Authors@R: person("Matthew", "Lincoln", email = "mlincol1@umd.edu", role = c("aut", "cre")) +Authors@R: c( + person("Matthew", "Lincoln", email = "matthew.d.lincoln@gmail.com", role = c("aut", "cre")), + person("Louis", "Maddox", role = "ctb")) Description: Simple utility functions to read from and write to the system clipboards of Windows, OS X, and Linux. +Imports: utils License: GPL-3 LazyData: TRUE URL: https://github.com/mdlincoln/clipr diff --git a/R/clipboard.R b/R/clipboard.R index 70bf968..72ba225 100644 --- a/R/clipboard.R +++ b/R/clipboard.R @@ -5,6 +5,9 @@ #' @return A character vector with the contents of the clipboard. If the system #' clipboard is empty, returns NULL #' +#' @examples +#' clip_text <- read_clip() +#' #' @export read_clip <- function() { # Determine system type @@ -40,6 +43,13 @@ read_clip <- function() { #' Defaults to no terminator character, indicated by \code{NULL}. #' @return On successfully writing the input to the clipboard, this function #' returns the same input for use in piped operations. +#' +#' @examples +#' text <- "Write to clipboard" +#' write_clip(text) +#' +#' multiline <- c("Write", "to", "clipboard") +#' write_clip(multiline, sep = "\n") #' @export write_clip <- function(content, sep = NULL, eos = NULL) invisible({ # Determine system type diff --git a/README.md b/README.md index c767811..fc1f350 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ clipr ===== -[![Project Status: Wip - Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](http://www.repostatus.org/badges/0.1.0/wip.svg)](http://www.repostatus.org/#wip) +[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/0.1.0/active.svg)](http://www.repostatus.org/#active) + +[![CRAN status.](http://www.r-pkg.org/badges/version/clipr)]((http://www.r-pkg.org/pkg/clipr)) Simple utility functions to read and write from the system clipboards of Windows, OS X, and Linux. @@ -11,8 +13,7 @@ library("clipr") var <- read_clip() -write_clip("Text") -> [1] "Text" +write_clip(c("Text", "for", "clipboard"), sep = "\n") ``` --- diff --git a/cran-comments.md b/cran-comments.md new file mode 100644 index 0000000..cca06b0 --- /dev/null +++ b/cran-comments.md @@ -0,0 +1,9 @@ +This is my first submission. + +## Test environments +* local OS X install, R 3.2.2 +* local ubuntu 14.04, R 3.2.2 +* win-builder (devel and release) + +## R CMD check results +There were no ERRORs or WARNINGs. diff --git a/man/read_clip.Rd b/man/read_clip.Rd index 21ebb4d..4f889cc 100644 --- a/man/read_clip.Rd +++ b/man/read_clip.Rd @@ -13,4 +13,7 @@ A character vector with the contents of the clipboard. If the system \description{ Read the contents of the system clipboard into a character vector. } +\examples{ +clip_text <- read_clip() +} diff --git a/man/write_clip.Rd b/man/write_clip.Rd index 151261c..15ac33d 100644 --- a/man/write_clip.Rd +++ b/man/write_clip.Rd @@ -23,4 +23,11 @@ On successfully writing the input to the clipboard, this function \description{ Write a character vector to the system clipboard } +\examples{ +text <- "Write to clipboard" +write_clip(text) + +multiline <- c("Write", "to", "clipboard") +write_clip(multiline, sep = "\\n") +}