copy_rde_var: Encode, compress and copy data into the clipboard

Description Usage Arguments Details Value Examples

View source: R/save.R

Description

copy_rde_var is intended to work with load_rde_var. The normal workflow would use copy_rde_var to copy a variable to the clipboard and then paste it in to the third argument of load_rde_var.

Usage

1
copy_rde_var(var, line.width = 80L, no.clipboard = FALSE)

Arguments

var

the variable to copy

line.width

the desired width of lines of text (-1 for no line breaks)

no.clipboard

the default is FALSE. Indicates that you want the function to return the string that would have been copied to the clipboard without actually copying to the clipboard. This option is mainly used for testing purposes. Normal users will not use it.

Details

The variable in the argument var is first saved using saveRDS. Then the saved variable is compressed using bzip2 compression. Next, the compressed data is base 64 encoded into a character string. Next, that string is prepended with a code that indicates the version of this package. The prepended code (currently 'rde1' allows for future changes while providing backwards compatibility). Finally, the string is optionally broken up into lines of width line.width. Whitespace and line breaks are ignored by load_rde_var.

On X11 systems (e.g. Linux), external software is required in order to access the clipboard. Either 'xsel' or 'xclip' is required. Installation of this software will depend on the installation that you use, but on Ubuntu/Debian, 'sudo apt-get install xsel' will probably work.

On Windows and OSX, no additional software is required.

Value

None (or string if no.clipboard=TRUE)

Examples

1

kloppen/rde documentation built on June 30, 2020, 3:10 p.m.