line_to_vector: Turn line of items separated by spaces into c() command

line_to_vectorR Documentation

Turn line of items separated by spaces into c() command

Description

This takes a line of items separated by spaces, tabs or newlines and returns a c() vector command - with the items quoted or not. By default, the line is read from the clipboard and a character vector returned

Usage

line_to_vector(x = clipr::read_clip(), strings = TRUE, to_clip = TRUE)

Arguments

x

Character string of desired vector items, separated by spaces

strings

Should vector items be considered as strings, i.e. quoted.

to_clip

Should result be written to clipboard?

Examples

line_to_vector("a b c", to_clip = FALSE)
line_to_vector("1 2 3", s = FALSE, t = FALSE)

LukasWallrich/rNuggets documentation built on Aug. 26, 2022, 11:03 a.m.