[R-SIG-Mac] paste data into R

Andrew Beckerman a.beckerman at sheffield.ac.uk
Tue Jan 10 09:27:35 CET 2006


Sylvain/Simon -

Is it worth pointing out that read.csv("path/to/file.csv") will read  
the excel data in directly (as a saved as a csv file that is),  
without resorting to the clipboard and copy/paste mode?

Andrew

On 9 Jan 2006, at 22:57, Simon Urbanek wrote:

> Sylvain,
>
> On Jan 9, 2006, at 5:46 PM, Sylvain Charlat wrote:
>
>> Does anybody know how to copy / paste data from Excel to R?
>>
>> If I type the following:
>>
>>> read.table(file("clipboard"))
>>
>> or
>>
>>> read.delim(file("clipboard"))
>>
>> I get an error message:
>>
>>> Error in open.connection(file, "r") : X11 module cannot be loaded
>>
>
> Wrong connection, you should use pipe("pbpaste") - see ?pipe - so in
> your example it could look like this:
>
> read.table(pipe("pbpaste"),sep="\t")
>
> Cheers,
> Simon
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

------------------------------------------------------------------------ 
---------
Dr. Andrew Beckerman
Department of Animal and Plant Sciences, University of Sheffield,
Alfred Denny Building, Western Bank, Sheffield S10 2TN, UK
ph +44 (0)114 222 0026; fx +44 (0)114 222 0002
http://www.shef.ac.uk/beckslab
------------------------------------------------------------------------ 
----------



More information about the R-SIG-Mac mailing list