R Graphics Cookbook: Practical Recipes for Visualizing Data, 2/e (Paperback)

Winston Chang



This O’Reilly cookbook provides more than 150 recipes to help scientists, engineers, programmers, and data analysts generate high-quality graphs quickly—without having to comb through all the details of R’s graphing systems. Each recipe tackles a specific problem with a solution you can apply to your own project and includes a discussion of how and why the recipe works.

Most of the recipes in this second edition use the updated version of the ggplot2 package, a powerful and flexible way to make graphs in R. You’ll also find expanded content about the visual design of graphics. If you have at least a basic understanding of the R language, you’re ready to get started with this easy-to-use reference.

  • Use R’s default graphics for quick exploration of data
  • Create a variety of bar graphs, line graphs, and scatter plots
  • Summarize data distributions with histograms, density curves, box plots, and more
  • Provide annotations to help viewers interpret data
  • Control the overall appearance of graphics
  • Explore options for using colors in plots
  • Create network graphs, heat maps, and 3D scatter plots
  • Get your data into shape using packages from the tidyverse


這本 O'Reilly 的食譜書提供了150多個食譜,幫助科學家、工程師、程式設計師和數據分析師快速生成高質量的圖表,而不需要深入研究 R 的圖形系統的所有細節。每個食譜都解決了特定的問題,並提供了一個可以應用於自己的項目的解決方案,並討論了食譜的工作原理和原因。

這本第二版中的大部分食譜使用了更新的 ggplot2 套件,這是一種在 R 中製作圖表的強大而靈活的方式。您還會找到有關圖形視覺設計的擴展內容。如果您至少具有基本的 R 語言理解,您就可以開始使用這個易於使用的參考資料。

- 使用 R 的默認圖形快速探索數據
- 創建各種條形圖、折線圖和散點圖
- 使用直方圖、密度曲線、箱形圖等總結數據分佈
- 提供註釋以幫助觀眾解釋數據
- 控制圖形的整體外觀
- 探索在圖表中使用顏色的選項
- 創建網絡圖、熱力圖和3D散點圖
- 使用 tidyverse 套件整理數據形狀