> On Oct 3, 2018, at 9:22 AM, Robert Baer <rb...@atsu.edu> wrote:
> 
> My memory is that  on the Mac
> 
> dat = read.table(file = pipe("pbpaste"), header = TRUE)      # should allow 
> me to paste a dataframe copied from a spreadsheet into R.
> 
> When I try that in RStudio 1.1.456 with R 3.5.1 on OSX 10.13.1
> 
> I get the message:
> 
>   incomplete line found by readTableHeader on 'pbpaste'
> 
> Could anyone explain this message to me,  and more importantly, tell me the 
> proper way to paste a dataframe copied to the clipboard from Excel on the Mac?
> 
> 


Hi,

The default cell (field) delimiter with Excel is the TAB character, so you want 
to use something like:

  read.table(pipe("pbpaste"), sep = "\t", header = TRUE)

Note that you will likely get a warning along the lines of what you got above, 
which I believe is due to Excel not having an EOL for the final row in the 
clipboard.

Regards,

Marc Schwartz




        [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to