Learn R Programming

clipr (version 0.8.0)

read_clip: Read clipboard

Description

Read the contents of the system clipboard into a character vector.

Usage

read_clip(allow_non_interactive = Sys.getenv("CLIPR_ALLOW", interactive()))

Arguments

allow_non_interactive

By default, clipr will throw an error if run in a non-interactive session. Set the environment variable CLIPR_ALLOW=TRUE in order to override this behavior.

Value

A character vector with the contents of the clipboard. If the system clipboard is empty, returns NULL

Examples

Run this code
# NOT RUN {
clip_text <- read_clip()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab