[R-SIG-Mac] Cant read file from clipboard

Adrian Dușa du@@@@dr|@n @end|ng |rom gm@||@com
Fri Jan 17 14:36:48 CET 2025


 Package admisc has a function called scan.clipboard(), which is
cross-platform.
Hth,
Adrian


On 16 January 2025 at 20:18:07, Marc Schwartz via R-SIG-Mac (
r-sig-mac using r-project.org) wrote:

Hi,

On macOS, you would generally want to use:

read.delim(file = pipe("pbpaste"))

See the "Clipboard" section of ?connections, where you will find:

"macOS users can use pipe("pbpaste") and pipe("pbcopy", "w") to read from
and write to that system's clipboard."

Regards,

Marc Schwartz


> On Jan 16, 2025, at 1:06 PM, Christofer Bogaso <
bogaso.christofer using gmail.com> wrote:
>
> Hi,
>
> I tried below unsuccessfully,
>
> read.delim(file = 'clipboard')
>
> Error in file(file, "rt") : cannot open the connection
>
> In addition: Warning message:
>
> In file(file, "rt") : unable to contact X11 display
>
> Any pointer on how to resolve this issue will be very helpful.
>
>> sessionInfo()
>
> R version 4.4.0 (2024-04-24)
>
> Platform: aarch64-apple-darwin20
>
> Running under: macOS 15.2
>
>
> Matrix products: default
>
> BLAS:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib

>
> LAPACK:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;

> LAPACK version 3.12.0
>
>
> locale:
>
> [1] C/UTF-8/C/C/C/C
>
>
>
>
>
> attached base packages:
>
> [1] stats graphics grDevices utils datasets methods base
>
>
> other attached packages:
>
> [1] readxl_1.4.3
>
>
> loaded via a namespace (and not attached):
>
> [1] compiler_4.4.0 magrittr_2.0.3 cli_3.6.2 tools_4.4.0
>
> [5] pillar_1.9.0 glue_1.7.0 tibble_3.2.1 utf8_1.2.4
>
> [9] fansi_1.0.6 cellranger_1.1.0 vctrs_0.6.5 lifecycle_1.0.4
>
> [13] pkgconfig_2.0.3 rlang_1.1.4
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

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

	[[alternative HTML version deleted]]



More information about the R-SIG-Mac mailing list