Learn R Programming

psych (version 1.0-33)

read.clipboard: shortcut for reading from the clipboard

Description

input from the keyboard is easy but a bit obscure, particularly for Mac users. This is just an easier mnemonic to do so.

Usage

read.clipboard(header = TRUE, ...)

#my.data <- read.clipboad() #assumes headers and tab delimited #my.data <- read.clipboard.csv() #assumes heades and comma delimited

Arguments

header
Does the first row have variable labels
...
Other parameters to pass to read

Value

  • the contents of the clipboard.

Details

A typical session of R might involve data stored in text files, generated on line, etc. Although it is easy to just read from a file (particularly if using file.locate(), copying from the file to the clipboard and then reading from the clipboard is also very convenient (and somewhat more intuitive to the naive user.)

Based upon a suggestion by Ken Knoblauch to the R-help listserve.

Examples

Run this code
#my.data <- read.clipboad()
#my.data <- read.clipboard.csv()
#my.data <- read.clipboad(header=FALSE)

Run the code above in your browser using DataLab