Rotating and spacing axis labels in ggplot2

Change the last line to By default, the axes are aligned at the center of the text, even when rotated. When you rotate +/- 90 degrees, you usually want it to be aligned at the edge instead: The image above is from this blog post.

Categories R

Add text to ggplot

Consider using annotate() to place whatever text where you want at a given location on the plot. Factor variables, as in the clarity factor on the x-axis, have a number for each level, so you can use that number to locate the text. I assume date variables have the same usage.: EDIT after COMMENT For efficiency, you … Read more

Categories R

What does %*% mean in R [duplicate]

Use ?’%*%’ to get the documentation. %*% is matrix multiplication. For matrix multiplication, you need an m x n matrix times an n x p matrix.

Categories R