This package allows users to visualize their data using an online graphical user interface (GUI) that makes use of R's visualization package ggplot. There are two ways of using this functionality: 1) online, where users can upload their data and visualize it without needing R, by visiting this link: https://site.shinyserver.dck.gmw.rug.nl/ggplotgui/; 2) from within the R-environment (by using the ggplot_shiny()
function). In either case, R-code will be provided such that the user can recreate the graphs within the R-environment.
R is amazing, but daunting for many. The programming style of R, compared to the point-and-click style of typical software, is a hurdle for many. Perhaps particularly so for those in the social sciences, whose statistical needs are often met by other software packages. Yet such packages are often very limited in terms of their options to visualize the data at hand. I believe that the amazing visualization-capabilities of R might be one way to get more people to use it. To lower the barrier to start using R, this package allows users to visualize their data using an online graphical user interface (GUI) that makes use of R's visualization package ggplot. There are two ways of using this functionality: 1) online, where users can upload their data and visualize it without needing R, by visiting this link: https://site.shinyserver.dck.gmw.rug.nl/ggplotgui/; 2) from within the R-environment (by using the ggplot_shiny() function). Importantly, the R-code will also be provided such that the user can recreate the graphs within the R-environment. The main aim (or hope) is to get more people using R and its wonderful (graphing) capabilities.
install.packages("ggplotgui")
# In order to install the most recent version of this package, you'll need to use the "devtools"-package
install.packages("devtools")
devtools::install_github("gertstulp/ggplotgui")
library("ggplotgui")
There are different ways to use this functionality:
- By calling it from within R
# You can call the function with and without passing a dataset
ggplot_shiny()
ggplot_shiny(mpg) # Passing ggplot's mpg dataset
- By using docker
# First build the docker image
docker build -t ggui .
# Then run the container
docker run --rm -p 3838:3838 -v $PWD/R:/srv/shiny-server/ ggui
Now navigate to http://localhost:3838/ggui/
- By using the following link: https://site.shinyserver.dck.gmw.rug.nl/ggplotgui/
This will open up the following screen: There are four ways in which you can use data within this GUI:
- You can pass your dataframe through R, by using ggplot_gui(my_df)
- You can examine sample data (data 'mpg' from the ggplot2 package)
- You can upload your datafile in many different formats (e.g., csv, SPSS, Excel)
- You can paste some data into a window (the data need to be "tidy")
A ggplot-graph can be made through point and click (after data is loaded and through the ggplot-tab): Aesthetics of the graph can be changed with the tabs on the right hand side.
An interactive version (through plotly) of the graph is displayed (the Plotly-tab) to allow for further exploration of the data:
Importantly, the R-code to recreate the graphs will be provided (in the R-code tab):
Currently, only widely used graphs are implemented: boxplots, density plots, dot + error plots, dotplots, histograms, scatter plots, and violin plots. Only a select number of aesthetic features can be changed. Please do report bugs and send feature requests.
I am grateful to the people who made R, and to Hadley Wickham for making such good packages (and open access books describing them), that allow even low-skilled and low-talented programmers like myself to be able to contribute to R. This package makes use of: ggplot2, Shiny, stringr, plotly, readr, readxl, haven, and RColorBrewer. Package development through RStudio and Github, and with the help of R Markdown and devtools. The code that allows for online data input was based somewhat on the BoxPlotR Shiny app. Many thanks to Wilmer Joling who set up the magical "docker" and website where the online version of this packages runs.