[R] ggplot2: coord_polar

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Mon Mar 12 07:43:18 CET 2012


Works for me on Windows XP with R 2.14.1 (not patched).

You may be too far out on the bleeding edge. Upgrading to 2.14.2 is probably the best first step. If that doesn't fix it then posting on R-devel (assuming you can identify the bug in R) or the ggplot mailing list is probably more appropriate than pursuing this issue here.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

Athula Herath <athula.herath at ntlworld.com> wrote:

>Hello HelpeRs,
>
>The last print statement in the code segment below results in :
>
>Error in data$x[data$x == -Inf] <- range$x.range[1] :
>  replacement has length zero
>
>
>R version 2.14.1 Patched (2011-12-23 r57982)
>
>ggplot2: version 0.90
>
>OS     : Linux (64bit)
>
>
>Any thoughts?
>
>
>Many Thanks,
>
>
>A.
>
>
>## code segment starts here
>
>
>df <- data.frame(
>  trt = factor(c(1, 1, 2, 2)),
>  resp = c(1, 5, 3, 4),
>  group = factor(c(1, 2, 1, 2)),
>  se = c(0.1, 0.3, 0.3, 0.2)
>  )
>df2 <- df[c(1,3),]
>
>limits <- aes(ymax = resp + se, ymin=resp - se)
>dodge <- position_dodge(width=0.9)
>
>p <- ggplot(df2, aes(fill=group, y=resp, x=trt))
>p <- p + geom_bar(position=dodge)
>
>
># This is OK
>print(p)
>
># This is OK
>print(p + coord_polar())
>p <- p + geom_errorbar(limits, position=dodge, width=0.25)
>
># This is OK
>print(p)
>
># Error at the next statement
>print(p +  coord_polar())
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list