Learn R Programming

ggedit

ggplot2 has become the standard of plotting in R for many users. New users, however, may find the learning curve steep at first, and more experienced users may find it challenging to keep track of all the options (especially in the theme!).

ggedit is a package that helps users bridge the gap between making a plot and getting all of those pesky plot aesthetics just right, all while keeping everything portable for further research and collaboration.

ggedit is powered by a Shiny gadget where the user inputs a ggplot plot object or a list of ggplot objects. You can run ggedit directly from the console or from the Addin menu within RStudio.

Online User Manual Gitbook

A gitbook is maintained as the user manual for the package, you can access it here:

https://yonicd.github.io/ggedit/

Short clip from rstudio::conf 2017 (13:35-19:35)

Installation

CRAN

install.packages('ggedit')

For a quick example, run the following:

library('ggedit')
library(ggplot2)
p <- ggplot(mtcars, aes(x = hp, y = wt)) + geom_point() + geom_smooth()
p2 <- ggedit(p)
names(p2) # will show you which objects are available.
plot(p2) # shows the updated plot (it is available in the first element of p2)

DEV

remotes::install_github("yonicd/ggedit")

Limitations

  • layers
    • non colour aesthetics of numeric inputs are not currently supported, e.g.:

      iris |> 
        ggplot(aes(x = Sepal.Length, y = Sepal.Width)) +
        geom_point() + 
        geom_text(aes(label = Species, size = Sepal.Length))
    • geom_text: family is not currently open to change

Copy Link

Version

Install

install.packages('ggedit')

Monthly Downloads

1,023

Version

0.4.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Jonathan Sidi

Last Published

March 4th, 2024

Functions in ggedit (0.4.1)

-.gg

remove layer
fetch_layer_aes

fetch_layer_aes
fetch_aes_ggplotBuild

fetch_aes_ggplotBuild
geom_list

geom_list
ggedit

Interactive shiny gadget for editing ggplot layers and themes.
layersList

layersList
is.ggedit

Is the object of class ggedit
gg_session

retreive all functions that create ggroto layers or stats
gggsave

gggsave
ggedit_opts

Default and current ggedit options
is.gglist

gglist
gg_vetting

Backcheck what functions created the layers in a ggplot2 plot object
is.NullOb

is.NullOb
remove_geom

Remove a layer from a compiled ggplot2 object.
layersListFull

layersListFull
summary.ggedit

Print to console verbose outputs of objects of class ggedit
layersListObj

layersListObj
themeNewVal

themeNewVal
themePanel

themePanel
rmNullObs

rmNullObs
pList

List of plots for ggedit examples
rgg

Remove and replace ggplot2 layers.
vplayout

vplayout
+.gg

add layer
print.ggedit

Print ggedit objects
themeListDepth

themeListDepth
print.gglist

print.gglist
proto_features

ggplot2 layer proto extraction
themeMakePanel

themeMakePanel
themeFetch

themeFetch
themeFetchFull

themeFetchFull
as.gglist

recasts to gglist
as.ggedit

Try to coerce a ggplot object into a ggedit object
cloneRoot

clone root of ggplot object
class_layer

class_layer
cloneLayer

Creates an independent copy of a ggplot layer object
compare

compare
cloneScales

Clone ggplot2 scales from compiled ggplot objects
aesSlide

aesSlide
arg.value

arg.value
ggEditUI

ggEditUI
aesColour

aesColor
ggEdit_Module

ggEdit
cloneFacet

Clone ggplot facet object
aesSelect

aesSelect
aesColourCont

aesColorCont
dput.ggedit

Convert ggplot object to a string call