1 / 19

Some Possibly Useful Graphics Functions

Some Possibly Useful Graphics Functions. Lunch presentation. GGPlot2. Hadley Wickham Grammar Of Graphics GGPlot2 Website If I see it on the GGPlot2 page it might be easier/better looking to use than using R plot function. Syntax. What I’m used to: Plot(x,y , col =whatever, main=whatever)

ursala
Download Presentation

Some Possibly Useful Graphics Functions

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Some Possibly Useful Graphics Functions Lunch presentation

  2. GGPlot2 • Hadley Wickham • Grammar Of Graphics • GGPlot2 Website • If I see it on the GGPlot2 page it might be easier/better looking to use than using R plot function

  3. Syntax • What I’m used to: • Plot(x,y, col=whatever, main=whatever) • Legend(…) • par(mfrow=c(1,2))

  4. Syntax • What I’m used to: • Plot(x,y, col=whatever, main=whatever) ggplot(dataFrame,aes(x,y,sometimesz) + the name of the plot you want + • Legend(…) + options like labels/colors/text/lines • par(mfrow=c(x,y)) grid.newpage() pushViewport(viewport(layout = grid.layout(x, y))) viewport(layout.pos.row = x, layout.pos.col = y)

  5. How Might it be Useful • Do you have your data in a data.frame? • Are you ok with acceding control of the details? • Do you anticipate summarizing your data by one or more variables in your data frame? • Do you see your plot or something like it on Hadley’s page?

  6. R Plot Function

  7. R Plot Function Again

  8. R Barplot Function

  9. geom_bar

  10. Specify Factor Levels

  11. Specify Arbitrary Factor Levels

  12. geom_point

  13. Remove Background Grid

  14. Specify Colors

  15. Change legend label

  16. Change title and axes labels

  17. geom_point

  18. Facet by sample

  19. Flip it

More Related