Skip to main content
main-content

Über dieses Buch

This book and app is for practitioners, professionals, researchers, and students who want to learn how to make a plot within the R environment using ggplot2, step-by-step without coding.
In widespread use in the statistical communities, R is a free software language and environment for statistical programming and graphics. Many users find R to have a steep learning curve but to be extremely useful once overcome. ggplot2 is an extremely popular package tailored for producing graphics within R but which requires coding and has a steep learning curve itself, and Shiny is an open source R package that provides a web framework for building web applications using R without requiring HTML, CSS, or JavaScript.
This manual—"integrating" R, ggplot2, and Shiny—introduces a new Shiny app, Learn ggplot2, that allows users to make plots easily without coding. With the Learn ggplot2 Shiny app, users can make plots using ggplot2 without having to code each step, reducing typos and error messages and allowing users to become familiar with ggplot2 code. The app makes it easy to apply themes, make multiplots (combining several plots into one plot), and download plots as PNG, PDF, or PowerPoint files with editable vector graphics. Users can also make plots on any computer or smart phone.
Learn ggplot2 Using Shiny App allows users toMake publication-ready plots in minutes without codingDownload plots with desired width, height, and resolutionPlot and download plots in png, pdf, and PowerPoint formats, with or without R code and with editable vector graphics

Inhaltsverzeichnis

Frontmatter

Chapter 1. Make a Plot with a Click

Please select one of the six available servers at R-graph.com.

Keon-Woong Moon

Chapter 2. Make a Plot by ggplot2

In the previous chapter, you have learned how to make a plot with just a click, without coding and applying various themes to the plot.

Keon-Woong Moon

Chapter 3. Show Data Distribution

In this chapter, you can learn how to make a plot summarized data distribution.

Keon-Woong Moon

Chapter 4. Scatter Plots(I)

In this chapter, you can learn how to make a scatter plots to show the relationship between two variables.

Keon-Woong Moon

Chapter 5. Scatter Plot(II)

In this chapter, you can learn about jittering. The scatter plot can be used for visualizing both continuous and categorical variables and jittering helps to make better looking plots.

Keon-Woong Moon

Chapter 6. Logistic Regression

The biopsy data in the MASS package contains histogic data from 699 breast tumors. The result of biopsy was recorded as “” or “malignancy” in class column. With this data, we wants to make this plot.

Keon-Woong Moon

Chapter 7. Labelling Points in a Scatter Plot

In this chapter, you can learn how to label points in a scatter plot. We use the mtcars data extracted from 1974 Motor Trend US magazine. This data comprises fuel consumption and 10 aspects of automobile design and performance for 32 automobiles(1973–1974 models).

Keon-Woong Moon

Chapter 8. Making a 2D Density Plot

In this chapter, you can learn how to make a 2D density plot using 2D data.

Keon-Woong Moon

Chapter 9. Drawing 2D Contours

In this chapter, you can learn how to draw a 2D contour. Function stat_contour() is used to display contours of a 3D surface in 2D.

Keon-Woong Moon

Chapter 10. Balloon Plot

Scatter plot usually shows the relationship between x- and y-axis variables. You can map the third variable to the size of area of dots and your plot shows the relationship among the three variables.

Keon-Woong Moon

Chapter 11. Cleveland Dot Plot

In this chapter, you can learn how to make a cleveland dot plot and how to sort a data using preprocessing.

Keon-Woong Moon

Chapter 12. Wilkinson Dot Plot

In this chapter, you can learnBoxplot how to make a Wilkinson dotplot and a dotplot overlaid on box plot.

Keon-Woong Moon

Chapter 13. Bar Plot(I)

In this chapter, you will learn how to make a bar plot.

Keon-Woong Moon

Chapter 14. Bar Plot(II)

In this chapter, you will learn to make a bar plot representing values in the dataset.

Keon-Woong Moon

Chapter 15. Labelling a Bar Plot(I)

In this chapter, you will learn how to add labels to bar plots representing counts. You can add labels using geom_text() function. If you want to add labels to a stacked bar plot or a proportional bar plot, some calculation will be needed.

Keon-Woong Moon

Chapter 16. Labelling a Bar Plot(II)

In this chapter, you will learn how to add labels to bar plots representing values of data. The preprocessing is different from those representing counts. We will use the cabaage_exp data in the package gcookbookGcookbook. This data set has groupwise means, standard deviations, counts, and standard errors of the mean for the cabbages data set from the MASSMASS package.

Keon-Woong Moon

Chapter 17. Line Graph

In this chapter, you will learn how to draw a line graph.

Keon-Woong Moon

Chapter 18. Multiplot with Error Bars

In this chapter, you will learn how to make a multiplotMultiplot with error bars.

Keon-Woong Moon

Chapter 19. Boxplot

In this chapter, you will learn how to make a boxplot. Your goal is notched boxplot with median values.

Keon-Woong Moon

Chapter 20. Violin Plot

In this chapter, you will learn how to make a violin plotViolin plot. The goal of this chapter is a violin plot overlapped with box plot, scatter plot, and statistical summary.

Keon-Woong Moon

Chapter 21. Area Plot

The R code for the area plot is cited from the book “R Graphics Cookbook” writtenR Graphics Cookbook by Winston ChangChang, Winston.

Keon-Woong Moon

Chapter 22. Polar Plot

You can draw a polar plot (circular plot) using a polar coordinate system that expresses the coordinate system as an angle and a length. You can use the coord_polar () function to convert usual Cartesian coordinate to the polar coordinate system.

Keon-Woong Moon

Chapter 23. Annotations

In addition to standard title, axis labels, and legends, you can add individual text or graphical elements, tables to intuitively understand graphs. In this chapter, you will learn how to annotateAnnotate the graph.

Keon-Woong Moon

Chapter 24. Add a Table Annotation

Tables and drawings can also be placed on the plot with annotation_custom() function.

Keon-Woong Moon

Chapter 25. Adding the Regression Results in Scatter Plot

In this chapter, you can learn how to put the regression line and the regression result table together in the scatter plot.

Keon-Woong Moon

Chapter 26. Heatmap

A heat map (or heatmap) is a graphical representation of data where the individual values contained in a matrix are represented as colors.

Keon-Woong Moon

Chapter 27. Horizontal Bar Plot

When drawing a bar graph, it is common to compare the height of the bars by placing a categorical variable on the x-axis and a continuous variable on the y-axis.

Keon-Woong Moon

Chapter 28. Horizontal Box Plot

When drawing a bar graph, it is common to place a categorical variable on the x-axis and a continuous variable on the y-axis.

Keon-Woong Moon

Chapter 29. Drawing a Map

There are several ways to draw a map. In this chapter, you can learn how to draw a map using map data in the mapsMaps package.

Keon-Woong Moon

Chapter 30. Choropleth Map

In this chapter, you can learn how to make a choropleth map. A choropleth map is a thematic map in which areas are shaded or colored according to variable values.

Keon-Woong Moon

Chapter 31. Interactive Plot

To make an interactive plot using ggplot2, you can use the plotly or the ggiraphGgiraph package. The two packages have different advantages. I have created the package ggiraphExtraGgiraphExtra, which makes interactive plot easily using ggplot2 and ggiraphGgiraph package, and released it to CRAN and GitHub. In this chapter, you will learn how to make an interactive plot using ggiraphExtraGgiraphExtra package.

Keon-Woong Moon

Backmatter

Weitere Informationen

Premium Partner

    Bildnachweise