A few days ago on the list I had wrestled with the aes() vs aes_string()
issue, along with the same issue with facetting.
The way I ended up handling the point you bring up, Baptiste, is perhaps
rather inefficient but my data sets are not large. I allow the user to pass
variables, then I use that
Hi Baptiste: Thanks for the suggestion. It will work perfectly.
I would have never considered assigning a color to a variable that contained
no colors at all! I guess this is part of the aesthetic concept, which I
haven't had time to reflect on much. Then later, specify a manual color
scale wh
Further to my previous reply, it occurred to me that ggplot2 would
only ever use data and colors in your calls to compareCats(): res =
res, fac1 = fac1, fac2 = fac2 have no effect whatsoever.
If you want the user to be able to specify the variables used in the
ggplot2 call, you probably want to lo
Hi,
I may be missing an important design decision, but could you not have
only a single data.frame as an argument of your function? From your
example, it seems that the colour can be mapped to the fac1 variable
of "data",
compareCats <- function(data) {
require(ggplot2)
p <- ggplot(data, a
Hello Again... I¹m making a faceted plot of a response on two categorical
variables using ggplot2 and having troubles with the coloring. Here is a
sample that produces the desired plot:
compareCats <- function(data, res, fac1, fac2, colors) {
require(ggplot2)
p <- ggplot(data, aes(fac1,
5 matches
Mail list logo