skill sharing combining base and ggplot2 graphics in r n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Skill sharing: Combining base and ggplot2 graphics in R. PowerPoint Presentation
Download Presentation
Skill sharing: Combining base and ggplot2 graphics in R.

Loading in 2 Seconds...

play fullscreen
1 / 5

Skill sharing: Combining base and ggplot2 graphics in R. - PowerPoint PPT Presentation


  • 124 Views
  • Uploaded on

Skill sharing: Combining base and ggplot2 graphics in R. GLEON Fellowship Workshop January 14-18, 2013 Sunapee, NH Richard Iestyn Woolway. Plotting with R. R provides several frameworks for composing figures. The simplest is the base graphics.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Skill sharing: Combining base and ggplot2 graphics in R.' - ike


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
skill sharing combining base and ggplot2 graphics in r

Skill sharing: Combining base and ggplot2 graphics in R.

GLEON Fellowship Workshop

January 14-18, 2013

Sunapee, NH

Richard IestynWoolway

plotting with r
Plotting with R
  • R provides several frameworks for composing figures.
  • The simplest is the base graphics.
  • Another plotting system of R is ggplot2, which allows users to create publishable figures with ease.
  • Has a good book explaining the philosophy behind it:

http://ggplot2.org/

plotting with r base graphics
Plotting with R – base graphics
  • I recently needed to create a multi panel figure composed of a line plot, continuous wavelet transform, and the autocorrelation of a time series .
  • This can easily be created in base graphics using either par() or layout().
  • I then decided to use ggplot2 to improve the quality of the acf plot in the third panel of the figure.
plotting with r ggplot2 graphics
Plotting with R – ggplot2 graphics
  • We can improve the quality of the acf plot with ggplot2:
  • However, as par() and layout() are only available with base graphics, we cannot mix base and ggplot graphics in a single figure window.
  • The most appropriate solution is to use the gridBasepackage.
  • The script called ‘RIW_code.R’ shows how gridBase is used.
integration of base and ggplot graphics
Integration of base and ggplot graphics
  • gridBase provides similar functionality to par(mfrow=c(x,y)).
  • This is an useful technique when we wish to create multiple panel figures that combines plots based on base graphics (e.g. biplots), that have not been implemented in grid (i.e. ggplot), and the task of re-implementing in grid is extremely daunting.