Error In Grid.call.graphicsl_lines X$x X$y Index X$arrow
Sign in Pricing Blog Support Search GitHub This repository Watch 243 Star 2,058 Fork 776 invalid hex digit in color or lty hadley/ggplot2 Code Issues 21 Pull requests 3 Projects 1 Wiki Pulse scale_linetype_manual Graphs New issue geom_step does not work when group has exactly one point #719 Closed mwts opened this Issue Nov 9, 2012 · 2 comments Projects None yet Labels None yet Milestone 0.10 Assignees No one assigned 2 participants mwts commented Nov 9, 2012 Using R and ggplot2 version 2.15.1 d <- data.frame(x=1:3,y=1:3,g=c('a','a','b')) ggplot(d, aes(x=x,y=y, color=g)) + geom_point() + geom_step() # Error in isIncomplete(con) : invalid connection # Error in isIncomplete(con) : invalid connection # Error in grid.Call.graphics(L_lines, x$x, x$y, index, x$arrow) : # invalid line type The same occurs with geom_line() in place of geom_step() I would expect that geom_step simply draw nothing when group has size 1 mwts commented Nov 19, 2012 Same behavior for geom_density: works when group has size 2 or more, but throw an error when size is exactly 1 d <- data.frame(x=runif(100),f=factor(c(0,0,1,rep(2,97)))) ggplot(d, aes(x=x,fill=f)) + geom_bar() # OK ggplot(d, aes(x=x,fill=f)) + geom_density() ## Error in rowSums(vapply(x, is.finite, logical(nrow(x)))) : ## 'x' must be an array of at least two dimensions ## Error in UseMethod("scale_dimension") : ## no applicable method for 'scale_dimension' applied to an object of class "NULL" ggplot(subset(d,f!=1), aes(x=x,fill=f)) + geom_density() # OK Owner hadley commented Feb 24, 2014 This sounds like a great feature, but unfortunately we don't currently have the development bandwidth to support it. If you'd like to submit a pull request that implements this feature, please follow the instructions in the development vignette. hadley closed this Feb 24, 2014
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up R - ggplot geom_step error up vote 3 down vote favorite 1 I am trying to plot a graph of 3 observations (infusion rate, sedation level, tolerance level) as a function of time. I have data for https://github.com/hadley/ggplot2/issues/719 a hundred patients, which I want to see in separate panels. My data frame has the sedation level and tolerance level data in the same column, "Observation", while the infusion rate is in another column, "Rate". The three observations are grouped by the column "Subtype". So, far I can plot scatter plot and line with this code: p <- ggplot(data, aes(group = Subtype, colour = Subtype)) + facet_wrap(~ Pt_ID, ncol = 6) + geom_point(aes(Time, Observation)) + geom_point(aes(Time, Rate), colour = "pink") + http://stackoverflow.com/questions/25192621/r-ggplot-geom-step-error geom_line(aes(Time, Rate)) + geom_line(aes(Time, Observation)) However the graph is not what I wanted, I need to get a step plot. But when I use geom_step function with this code: p <- ggplot(data, aes(group = Subtype, colour = Subtype)) + facet_wrap(~ Pt_ID, ncol = 6) + geom_step(aes(Time, Observation)) + geom_step(aes(Time, Rate), colour="pink") I received this error message: Error in grid.Call.graphics(L_lines, x$x, x$y, index, x$arrow) : invalid line type I am rather new with R. If anyone can tell me what is wrong with my code or any suggestions, I'd really really appreciate it. r ggplot2 share|improve this question asked Aug 7 '14 at 21:34 pharavee 161 2 Welcome to SO! It is not possible to confirm the issue, since your example is not reproducible. Please add a minimal data set to your post so that others can run your code and see what happens. –tonytonov Aug 8 '14 at 5:21 add a comment| active oldest votes Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook. Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Browse other questions tagged r ggplot2 or ask your own question. asked 2 years ago viewed 2
be down. Please try the request again. Your cache administrator is webmaster. Generated Tue, 11 Oct 2016 18:55:03 GMT by s_wx1131 (squid/3.5.20)
be down. Please try the request again. Your cache administrator is webmaster. Generated Tue, 11 Oct 2016 18:55:05 GMT by s_wx1131 (squid/3.5.20)