Skip to contents

The format of the copied data is tab-delimited for pasting into a spreadsheet.

There are 2 ways to pass data into the function:

  1. Type it out the same as any other function.

  2. Highlight a data object in your RStudio text editor and then press key-chord: ctrl + alt + shift + c. (Use the quick keys just like you use ctrl + c for copying, except that copy_for_xl() uses all 3 control keys plus the 'c'.

Usage

copy_for_xl(. = NULL)

Arguments

.

a dataframe or object that can be coerced to a dataframe

Value

the data provided coerced to a tibble; clipboard data as side-effect

Details

To set up the key-chord in RStudio, use set_xlr_key_chords().

Copying formatted output to the clipboard requires package clipr.

If using Linux, make sure to install a clipboard tool: apt-get install xclip or apt-get install xsel

copy_for_xl() coerces the input data object to a tibble prior to copying to clipboard.

Note

All quick-keys in .pkg xlr use all 3 control keys ctrl + alt + shift plus a letter.

Examples

if (FALSE) {

copy_for_xl(iris)
copy_for_xl(letters)
colours() |> copy_for_xl()
head(mtcars) |> copy_for_xl()
colours() |> rlang::set_names() |> entibble(another_col = colours()) |> copy_for_xl()
dplyr::bind_cols(letters, LETTERS) |> head() |> copy_for_xl()
rlang::set_names(letters, LETTERS) |> copy_for_xl()

# To use quick keys. Run {.fn set_xlr_key_chords}.
# Then highlight the word 'letters' below and press key-chord `ctrl + alt + shift + c`.
letters

}