2

I'm looking for the equivalent of:

ggplot(df,aes(x=date,y=var1,**group=col1,colour=col1**))+geom_line() 

in the googleVis package.

Anyone knows how to do this? I only found examples of differently colored lines if they are mapping different columns from the dataframe.

thanks!

erasmortg
  • 3,246
  • 1
  • 17
  • 34
mtoto
  • 23,919
  • 4
  • 58
  • 71

1 Answers1

1

@mtoto, I hope my answer here on ggplot2 equivalent of 'factorization or categorization' in googleVis in R can help. Have you taken a look?

Using roles you can specify specific styles for your data. It involves adding another column with the style detail. So if plotting varx, you need to add the column varx.style where you will set the colors.

I do not know ggplot well enough to know if this is the exact fit of what you want, but please take a look at my figures and links in that answer.

Community
  • 1
  • 1
micstr
  • 5,080
  • 8
  • 48
  • 76
  • Hi micstr, thanks for the workaround! I find myself working with googlevis less and less however, as it is not as intuitive and easy-to-use than ggplot or ggvis. – mtoto Sep 29 '15 at 08:45
  • Thanks @mtoto - I might give `ggvis` a whirl as `googleVis` is creating some graphic hiccups with axes on Chrome – micstr Sep 29 '15 at 08:48