本文へスキップ
からだにいいもの

Rのトピックスを中心に『まだ、まだ、知らない、役に立つ情報?』を発信します。

Analysis in R: Clipboard data in and out! The “clipr” package

This is an introduction to a package that is useful for “reading and writing” clipboard data. You can manipulate the clipboard with commands without using this package, but it is slightly different and cumbersome depending on the OS environment. This package allows you to manipulate the clipboard without worrying about the OS environment.

Why not use it when you need to quickly process overflowing data from the web in R?

Package version is 0.8.0. Checked with R version 4.2.2.

Install Package

Run the following command.

#Install Package
install.packages("clipr")
スポンサーリンク

Example

See the command and package help for details.

#Loading the library
library("clipr")

###Creating Data#####
n <- 150
TestData <- data.frame("SubGroup" = sample(c("KA", "RA", "DA"), n, replace = TRUE),
                       "ID" = sample(letters[1:24], n, replace = TRUE),
                       "Area" = 1:n, "Point" = 0.1:(0.1*n),
                       "Facet" = sample(letters[1:2], n, replace = TRUE),
                       "No" = sample(1:10, n, replace = TRUE))
########

#Writes example data to the clipboard:write_clip command
#Specify data line breaks:sep option
#Add charactor at the end:eos option;Display nothing:NULL
write_clip(content = TestData, sep = NULL, eos = NULL)

#Reads example data to the clipboard:read_clip command
#Note that the read_clip command does not support image copying
#Execute after copying the above two lines
read_clip()
[1] "#Reads example data to the clipboard:read_clip command"         
[2] "#Note that the read_clip command does not support image copying"

I hope this makes your analysis a little easier !!

スポンサーリンク
価格および配送状況は変更される場合があります。購入時は商品ページをご確認ください。
当サイトに表示されている商品情報はAmazonから提供されたものであり、更新または削除される場合があります。
karada-goodはAmazonアソシエイトとして、適格販売により収入を得ています。