Every time I make a plot using ggplot, I spend a little while trying different values for hjust and vjust in a line like + opts(axis.text.x = theme_text(hjust =...
I want to annotate some text on last facet of the plot with the following code: library(ggplot2) p <- ggplot(mtcars, aes(mpg, wt)) + geom_point() p <- p + facet_grid(....
I’m plotting a categorical variable and instead of showing the counts for each category value. I’m looking for a way to get ggplot to display the percentage of values...
EDIT: Hadley Wickham points out that I misspoke. R CMD check is throwing NOTES, not Warnings. I’m terribly sorry for the confusion. It was my oversight. The short version...
I’ve been getting up to speed with R in the last month. Here is my question: What is a good way to assign colors to categorical variables in ggplot2...
I have a really simple question, which I am struggling to find the answer to. I hoped someone here might be able to help me. An example dataframe is...
The data I’m playing with comes from the internet source listed below nba <- read.csv("http://datasets.flowingdata.com/ppg2008.csv", sep=",") What I want to do, is create a 2D points graph comparing two...
With this data frame (“df”): year pollution 1 1999 346.82000 2 2002 134.30882 3 2005 130.43038 4 2008 88.27546 I try to create a line chart like this: plot5...
I am plotting a graph with a categorical variable on the x axis and a numerical variable on the y axis. For the x axis, given that there are...
I’m generating plots for some data, but the number of ticks is too small, I need more precision on the reading. Is there some way to increase the number...