R Graphics Cookbook
O'Reilly Media, Inc, USA (Verlag)
978-1-4493-1695-2 (ISBN)
- Titel gebraucht verfügbar
- Artikel merken
...gebraucht verfügbar!
Most of the recipes use the ggplot2 package, a powerful and flexible way to make graphs in R. If you have a basic understanding of the R language, you’re ready to get started.
- 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 other examples
- Provide annotations to help viewers interpret data
- Control the overall appearance of graphics
- Render data groups alongside each other for easy comparison
- Use colors in plots
- Create network graphs, heat maps, and 3D scatter plots
- Structure data for graphing
Winston Chang is presently a graduate student studying cognitive psychology at Northwestern University. During his time as a graduate student, he created a website called "R Cookbook", which contains snippets of code to handle common tasks in R. In previous lives, he's been a philosophy graduate student and a computer programmer.
Chapter 1 R Basics
Installing a Package
Loading a Package
Loading a Delimited Text Data File
Loading Data from an Excel File
Loading Data from an SPSS File
Chapter 2 Quickly Exploring Data
Creating a Scatter Plot
Creating a Line Graph
Creating a Bar Graph
Creating a Histogram
Creating a Box Plot
Plotting a Function Curve
Chapter 3 Bar Graphs
Making a Basic Bar Graph
Grouping Bars Together
Making a Bar Graph of Counts
Using Colors in a Bar Graph
Coloring Negative and Positive Bars Differently
Adjusting Bar Width and Spacing
Making a Stacked Bar Graph
Making a Proportional Stacked Bar Graph
Adding Labels to a Bar Graph
Making a Cleveland Dot Plot
Chapter 4 Line Graphs
Making a Basic Line Graph
Adding Points to a Line Graph
Making a Line Graph with Multiple Lines
Changing the Appearance of Lines
Changing the Appearance of Points
Making a Graph with a Shaded Area
Making a Stacked Area Graph
Making a Proportional Stacked Area Graph
Adding a Confidence Region
Chapter 5 Scatter Plots
Making a Basic Scatter Plot
Grouping Data Points by a Variable Using Shape or Color
Using Different Point Shapes
Mapping a Continuous Variable to Color or Size
Dealing with Overplotting
Adding Fitted Regression Model Lines
Adding Fitted Lines from an Existing Model
Adding Fitted Lines from Multiple Existing Models
Adding Annotations with Model Coefficients
Adding Marginal Rugs to a Scatter Plot
Labeling Points in a Scatter Plot
Creating a Balloon Plot
Making a Scatter Plot Matrix
Chapter 6 Summarized Data Distributions
Making a Basic Histogram
Making Multiple Histograms from Grouped Data
Making a Density Curve
Making Multiple Density Curves from Grouped Data
Making a Frequency Polygon
Making a Basic Box Plot
Adding Notches to a Box Plot
Adding Means to a Box Plot
Making a Violin Plot
Making a Dot Plot
Making Multiple Dot Plots for Grouped Data
Making a Density Plot of Two-Dimensional Data
Chapter 7 Annotations
Adding Text Annotations
Using Mathematical Expressions in Annotations
Adding Lines
Adding Line Segments and Arrows
Adding a Shaded Rectangle
Highlighting an Item
Adding Error Bars
Adding Annotations to Individual Facets
Chapter 8 Axes
Swapping X- and Y-Axes
Setting the Range of a Continuous Axis
Reversing a Continuous Axis
Changing the Order of Items on a Categorical Axis
Setting the Scaling Ratio of the X- and Y-Axes
Setting the Positions of Tick Marks
Removing Tick Marks and Labels
Changing the Text of Tick Labels
Changing the Appearance of Tick Labels
Changing the Text of Axis Labels
Removing Axis Labels
Changing the Appearance of Axis Labels
Showing Lines Along the Axes
Using a Logarithmic Axis
Adding Ticks for a Logarithmic Axis
Making a Circular Graph
Using Dates on an Axis
Using Relative Times on an Axis
Chapter 9 Controlling the Overall Appearance of Graphs
Setting the Title of a Graph
Changing the Appearance of Text
Using Themes
Changing the Appearance of Theme Elements
Creating Your Own Themes
Hiding Grid Lines
Chapter 10 Legends
Removing the Legend
Changing the Position of a Legend
Changing the Order of Items in a Legend
Reversing the Order of Items in a Legend
Changing a Legend Title
Changing the Appearance of a Legend Title
Removing a Legend Title
Changing the Labels in a Legend
Changing the Appearance of Legend Labels
Using Labels with Multiple Lines of Text
Chapter 11 Facets
Splitting Data into Subplots with Facets
Using Facets with Different Axes
Changing the Text of Facet Labels
Changing the Appearance of Facet Labels and Headers
Chapter 12 Using Colors in Plots
Setting the Colors of Objects
Mapping Variables to Colors
Using a Different Palette for a Discrete Variable
Using a Manually Defined Palette for a Discrete Variable
Using a Colorblind-Friendly Palette
Using a Manually Defined Palette for a Continuous Variable
Coloring a Shaded Region Based on Value
Chapter 13 Miscellaneous Graphs
Making a Correlation Matrix
Plotting a Function
Shading a Subregion Under a Function Curve
Creating a Network Graph
Using Text Labels in a Network Graph
Creating a Heat Map
Creating a Three-Dimensional Scatter Plot
Adding a Prediction Surface to a Three-Dimensional Plot
Saving a Three-Dimensional Plot
Animating a Three-Dimensional Plot
Creating a Dendrogram
Creating a Vector Field
Creating a QQ Plot
Creating a Graph of an Empirical Cumulative Distribution Function
Creating a Mosaic Plot
Creating a Pie Chart
Creating a Map
Creating a Choropleth Map
Making a Map with a Clean Background
Creating a Map from a Shapefile
Chapter 14 Output for Presentation
Outputting to PDF Vector Files
Outputting to SVG Vector Files
Outputting to WMF Vector Files
Editing a Vector Output File
Outputting to Bitmap (PNG/TIFF) Files
Using Fonts in PDF Files
Using Fonts in Windows Bitmap or Screen Output
Chapter 15 Getting Your Data into Shape
Creating a Data Frame
Getting Information About a Data Structure
Adding a Column to a Data Frame
Deleting a Column from a Data Frame
Renaming Columns in a Data Frame
Reordering Columns in a Data Frame
Getting a Subset of a Data Frame
Changing the Order of Factor Levels
Changing the Order of Factor Levels Based on Data Values
Changing the Names of Factor Levels
Removing Unused Levels from a Factor
Changing the Names of Items in a Character Vector
Recoding a Categorical Variable to Another Categorical Variable
Recoding a Continuous Variable to a Categorical Variable
Transforming Variables
Transforming Variables by Group
Summarizing Data by Groups
Summarizing Data with Standard Errors and Confidence Intervals
Converting Data from Wide to Long
Converting Data from Long to Wide
Converting a Time Series Object to Times and Values
Appendix Introduction to ggplot2
Background
Colophon
Erscheint lt. Verlag | 11.1.2013 |
---|---|
Zusatzinfo | Illustrations |
Verlagsort | Sebastopol |
Sprache | englisch |
Maße | 178 x 233 mm |
Gewicht | 789 g |
Einbandart | Paperback |
Themenwelt | Mathematik / Informatik ► Informatik ► Theorie / Studium |
Mathematik / Informatik ► Mathematik ► Computerprogramme / Computeralgebra | |
Mathematik / Informatik ► Mathematik ► Statistik | |
ISBN-10 | 1-4493-1695-6 / 1449316956 |
ISBN-13 | 978-1-4493-1695-2 / 9781449316952 |
Zustand | Neuware |
Haben Sie eine Frage zum Produkt? |
aus dem Bereich