remove_unnecessary_marks: remove parentheses and marks

Description Usage Arguments Details

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

1
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.


caprice-j/ggbash documentation built on May 13, 2019, 12:11 p.m.