Skip to content

Read from clipboardΒ #656

@danielsjf

Description

@danielsjf

I was wondering if reading from a clipboard will be supported in the future? There was an earlier issue which provided a work-around, but it doesn't seem to work anymore.

> x <- readr::read_csv(file("clipboard"))
Error in read_connection_(con) : can only read from a binary connection
> x <- readr::read_csv(file("clipboard", open = 'rb'))
Error in file("clipboard", open = "rb") : 
  'mode' for the clipboard must be 'r' or 'w'

read_csv can only read from a binary connection while the connection itself only allows for non-binary connections.

Using the base functions, this is quite straightforward.

> x <- read.csv("clipboard", sep = '\t')
> x
  a b c
1 1 2 3
2 4 5 6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions