Learn R Programming

optigrab (version 0.9.2.1)

str_to_opts: Split a string bases on whitespace

Description

Split a string based on whitespace ignore single- and double quoted entries

Usage

str_to_opts(x = character())

Arguments

x

character; string to parse as if it is a command line

This is an internal function used predominantly for testing. It might be deprecated in the near future.

Value

A character array that could be similar to that provided by commandArgs.

See Also

base::commandArgs()

Examples

Run this code
# NOT RUN {
  
# }
# NOT RUN {
    str <- 'cmd -t "Say Anything" --character \'Lloyd Dobler\''
    str_to_opts(str)
    split_ws_nonquote(str)
  
# }
# NOT RUN {
  
# }

Run the code above in your browser using DataLab