-
Book Overview & Buying
-
Table Of Contents
R Graph Essentials
Let's assume that your data is loaded into R and now you wish to create a graph using the qplot() command. The generic qplot syntax is as follows:
qplot(x = X1, y = X2, data = X3, color = X4, shape = X5, size = X6, geom = X7, main = "Title")
Here, X represents the variables you wish to graph and the attributes you choose for your graph. You now have either univariate (one variable) or bivariate data (two variables), and you must provide instructions through the geom argument in order to create your graph. Now, let's explore some of the arguments in the qplot syntax:
data: This argument refers to the dataset.
color: This argument maps the color scheme onto a factor or numeric variable. Note that qplot selects default colors for each level of the variable. However, you can use special syntax to set your own colors.
shape: This argument maps symbol shapes on to factor variables, and qplot uses different shapes for different levels of the factor variable. You can use special...
Change the font size
Change margin width
Change background colour