Learn R Programming

ggbash (version 0.4.5)

remove_unnecessary_marks: remove parentheses and marks

Description

ggbash have to handle two types of parentheses and tyo types of commas. One is unnecessary and the other is necessary for correct parsing. For example, in gg(iris) + bin2d(x, y, binwidth=c(.1, .1)), all parentheses and commas before "binwidth" are unnecessary. So this should be replaced by gg iris + bin2d x y binwidth=c(.1, .1) , which can be parsed by ggplot2 compiler.

Usage

remove_unnecessary_marks(input = "gg(m, x=f(cyl), m) + t(l=p0('l:', w))")

Arguments

input

A character

Details

This is because while ggbash does not rely on commas and parens for parsing, R relies on them.