Learn R Programming

ggbash (version 0.4.5)

ggbash_: Enter into a ggbash session.

Description

ggbash_ executes a new ggbash session for faster ggplot2 plotting.

Usage

ggbash_(batch = "", clipboard = NULL, show_warn = TRUE,
  as_string = FALSE)

Arguments

batch

A character. If given, ggbash_() will exit just after executing the given command.

clipboard

Default is NULL If batch is non-empty and clipboard is non-NULL, ggbash copies a resulted ggplot2 object to clipboard. just after executing the given command.

show_warn

Whether to show a warning message when ambiguously matched. Default is TRUE.

as_string

Return the resulted ggplot2 object as a string not as a ggplot2 object. Default is FALSE. Ignored when non-batch mode.

Geom name:

the geom most frequently used (based on my experiences)

Column name:

the column with the smallest column index

Aesthetics:

required (x, y), non-missing (shape, size), default (alpha, stroke)

Value

nothing

Details

ggbash provides concise aliases for ggplot2 functions. By calling ggbash(), your R session goes into a ggbash session, which only interprets predefined ggbash commands. Some basic commands like setwd() or pwd() works in ggbash session, but most of the usual R grammars are disabled. Instead, a variety of ggbash commands are enabled for writing ggplot2 script as faster as possible.

If you give a string as a first argument of `ggbash`, ggbash will exit just after executing the command. Useful for a one-liner.

Examples

Run this code
# NOT RUN {
 ggbash() # enter into an interactive ggbash session

# plot a ggplot2 figure
ggbash_("gg iris + point Petal.Width Petal.Length")

#' # plot a ggplot2 figure and copy the result
ggbash_("gg iris + point Petal.Width Petal.Length", 1)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab