Skip to content

Commit

Permalink
Merge branch 'release0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlincoln committed Oct 7, 2015
2 parents 8a9aed7 + d14ed7f commit 39b760c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,7 +1,7 @@
Package: clipr
Type: Package
Title: Read and Write from the System Clipboard
Version: 0.1.1.9000
Version: 0.2.0
Authors@R: c(
person("Matthew", "Lincoln", email = "matthew.d.lincoln@gmail.com", role = c("aut", "cre")),
person("Louis", "Maddox", role = "ctb"))
Expand Down
20 changes: 20 additions & 0 deletions NEWS.md
@@ -1,3 +1,23 @@
## clipr 0.2.0

- Several changes to `write_clip`
- The separator to be used when writing a character vector can now be
explicitly declared using `breaks`. `breaks=NULL` will default to
system-specific line breaks for both vectors and tables.
- `write_clip` will default to formatting data.frames and matricies with
`write.table`, allowing easy pasting of tabular objects into programs like
Excel. Option `object_type="auto"` will check the object type to decide on the
correct formatting, or the user may explicitly state `object_type="table"` or
`object_type="character"`.
- clipr will default to sane system-specific options for `write.table()`,
however you may pass any custom desired options via `write_clip`
- `return_new=TRUE` (the default behavior) will return the formatted
character string that was passed to the system clipboard, while
`write_clip(return_new=FALSE)` will return the original object.

- Introduces `clear_clip`, a wrapper function for `write_clip("")` for easy
clearing of the system clipboard.

## clipr 0.1.1

- Bug fix that removes the explicit test for "Linux" in favor of a check for
Expand Down
6 changes: 6 additions & 0 deletions R/clipboard.R
Expand Up @@ -5,6 +5,12 @@
#' @return A character vector with the contents of the clipboard. If the system
#' clipboard is empty, returns NULL
#'
#' @note \code{read_clip} will not try to guess at how to parse copied text. If
#' you are copying tabular data, it is suggested that you use
#' \code{\link[readr]{read_delim}} or one of its sibling functions from the
#' readr package (\url{https://cran.r-project.org/package=readr}) to coax the
#' text into a data frame.
#'
#' @examples
#' clip_text <- read_clip()
#'
Expand Down
7 changes: 0 additions & 7 deletions cran-comments.md
@@ -1,10 +1,3 @@
## Resubmission
This is a resubmission. In this version I have:

* Removed the check for a "Linux" system. Instead, if system != "Darwin" or "Windows", will assume a Unix-like system

* Reimplemented the check for 'xclip' and/or 'xsel'. The following error will still be thrown if neither program is installed: `Error: Clipboard on Unix-like systems requires 'xclip' (recommended) or 'xsel'.`

## Test environments
* local OS X install, R 3.2.2
* local ubuntu 14.04, R 3.2.2
Expand Down
7 changes: 7 additions & 0 deletions man/read_clip.Rd
Expand Up @@ -13,6 +13,13 @@ A character vector with the contents of the clipboard. If the system
\description{
Read the contents of the system clipboard into a character vector.
}
\note{
\code{read_clip} will not try to guess at how to parse copied text. If
you are copying tabular data, it is suggested that you use
\code{\link[readr]{read_delim}} or one of its sibling functions from the
readr package (\url{https://cran.r-project.org/package=readr}) to coax the
text into a data frame.
}
\examples{
clip_text <- read_clip()
}
Expand Down

0 comments on commit 39b760c

Please sign in to comment.