read_cb: Read Data with Header from Clipboard

Description Usage See Also Examples

View source: R/clipboard.R

Description

Shortcut for 'read_clipboard(header = TRUE)'. To read headerless data from the clipboard, use read_cp_hl.

Usage

1

See Also

Other clipboard functions: copy_cb(), copy_to_clipboard(), read_cb_hl(), read_cb_trbl(), read_clipboard()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
library(tidyverse)

# Test Data
test_data <-
        tibble(A = 1:3,
               B = c("Apples", "Bananas", "Oranges"),
               C = factor(c("Apples", "Bananas", "Oranges")),
               D = runif(3))


# Copy to Clipboard
copy_cb(data = test_data)

# Read Clipboard
read_cb()

# Check Datatypes
sapply(test_data, FUN = class)
sapply(read_cb(), FUN = class) # `read_cb()` function mutates all factors to character before returning

# Read Clipboard Shortcut for Headerless Data
read_cb_hl()

# Read Clipboard as a Tribble for Copy and Paste
read_cb_trbl()
read_cb_trbl(header = FALSE)
read_cb_trbl(quote = "'")
read_cb_trbl(header = FALSE, quote = "'")

meerapatelmd/broca documentation built on Dec. 27, 2021, 2:03 p.m.