[R] Reading one column .csv file

Berend Hasselman bhh at xs4all.nl
Thu Aug 16 06:01:17 CEST 2012


On 15-08-2012, at 23:11, darnold wrote:

> Peter,
> 
> Interesting. Never heard of copying from the clipboard. I am also on a
> MacBook Pro, but I cannot get it to work. 
> 

So you are running Mac OS X?

> 1. I selected the column of data (including the header) in Excel.
> 
> 2. Selected Edit->Copy.
> 
> 3. In R, tried:
> 
>> a <- read.delim("clipboard")
> Error in file(file, "rt") : cannot open the connection
> In addition: Warning message:
> In file(file, "rt") : clipboard cannot be opened or contains no text
> 
> 4. I checked the clipboard. The data is there.


See ? connections  Section "Clipboard"

a <- read.delim(pipe("pbpaste"))

Berend



More information about the R-help mailing list