Giter Club home page Giter Club logo

qcc_ggplot's People

Contributors

tomhopper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

qcc_ggplot's Issues

ggplot_gtable(ggplot_build(qc.gplot)) Broken under ggplot2 2.0

Building a qcc plot now fails with an error:

Error in order(data$PANEL, data$group, data$x) : 
  argument 3 is not a vector 
14 order(data$PANEL, data$group, data$x) 
13 `[.data.frame`(data, order(data$PANEL, data$group, data$x), ) 
12 data[order(data$PANEL, data$group, data$x), ] 
11 f(...) 
10 self$geom$setup_data(data, c(self$geom_params, self$aes_params)) 
9 f(..., self = self) 
8 l$compute_geom_1(d) 
7 f(l = layers[[i]], d = data[[i]]) 
6 by_layer(function(l, d) l$compute_geom_1(d)) 
5 ggplot_build(qc.gplot) 
4 ggplot_gtable(ggplot_build(qc.gplot)) 
3 plot.qcc(object, ...) 
2 plot(object, ...) 
1 qcc(my.xmr.raw, type = "xbar.one", title = "Individuals Chart\nfor Wheeler sample data") 

Error when plotting.

> packageVersion("ggplot2")
[1] ‘2.2.1’
> x <- qcc(my.xmr.raw, type = "xbar.one", newdata = my.xmr.new, plot = TRUE)
 Hide Traceback

 Rerun with Debug
 Error: Discrete value supplied to continuous scale 
22. stop("Discrete value supplied to continuous scale", call. = FALSE) 
21. scales::train_continuous(x, self$range) 
20. f(..., self = self) 
19. self$range$train(x) 
18. f(..., self = self) 
17. scales[[i]][[method]](data[[var]][scale_index[[i]]]) 
16. FUN(X[[i]], ...) 
15. lapply(seq_along(scales), function(i) {
            scales[[i]][[method]](data[[var]][scale_index[[i]]])
      }) 
14. FUN(X[[i]], ...) 
13. lapply(vars, function(var) {
            pieces <- lapply(seq_along(scales), function(i) {
            scales[[i]][[method]](data[[var]][scale_index[[i]]])
      }) ... 
12. scale_apply(layer_data, x_vars, "train", SCALE_X, x_scales) 
11. f(...) 
10. self$train_scales(x_scales, y_scales, layout, data, self$params) 
9. f(..., self = self) 
8. self$facet$train_positions(self$panel_scales$x, self$panel_scales$y, 
            layout, data) 
7. f(..., self = self) 
6. layout$train_position(data, scale_x(), scale_y()) 
5. ggplot_build(qc.gplot) 
4. ggplot_gtable(ggplot_build(qc.gplot)) at qcc.plot.R#336
3. plot.qcc(object, ...) 
2. plot(object, ...) 
1. qcc(my.xmr.raw, type = "xbar.one", newdata = my.xmr.new, plot = TRUE) 

Setting rules to other than shewhart.rules returns error

qcc(my_data, type = "xbar.one", rules = beyond.limits)
Error in violations$violating.runs :
$ operator is invalid for atomic vectors
qcc(my_data, type = "xbar.one", rules = violating.runs)
Error in violations$violating.runs :
$ operator is invalid for atomic vectors

Apply user-supplied axis tick labels

The labels argument to qcc() is used to label the x-axis with user-supplied character vector labels in the qcc package. This functionality is not implemented in the current ggplot2 rewrite.

Axis tick mark orientation not implemented

plot.qcc() in the qcc package allows a user-defined orientation for axis tick mark labels via the axes.las argument. This functionality is not implemented in the current ggplot2 rewrite.

Extending qcc_ggplot to use ggplotly

Would it be possible to add an option for your implementation to use plotly on top of ggplot? It would be nice to have some interactivity with the plots.

Adding newdata argument breaks code

my_data <- c(5054, 4350, 4350, 3975, 4290, 4430, 4485, 4285, 3980, 3925, 3645, 3760, 3300, 3685, 3463, 5200)
qcc(my_data, type = "xbar.one", rules = shewhart.rules, newdata = my_data[1:6])
Hide Traceback

Rerun with Debug
Error: breaks and labels must have the same length
7 stop("breaks and labels must have the same length", call. = FALSE)
6 check_breaks_labels(breaks, labels)
5 continuous_scale(c("x", "xmin", "xmax", "xend", "xintercept"),
"position_c", identity, name = name, breaks = breaks, minor_breaks = minor_breaks,
labels = labels, limits = limits, expand = expand, oob = oob,
na.value = na.value, trans = trans, guide = "none")
4 scale_x_continuous(expand = c(0, 0.5), limits = xlim, breaks = df.indices,
labels = xlabs) at qcc.plot.R#185
3 plot.qcc(object, ...)
2 plot(object, ...)
1 qcc(my_data, type = "xbar.one", rules = shewhart.rules, newdata = my_data[1:6])

X-axis date intervals

I am using qcc_ggplot and the dates on the x-axis do not render appropriately. When I use base qcc, it renders the plot with readable labels (see below).

image

When I use qcc_ggplot, it renders every date which makes it unreadable. Is there perhaps a way to leverage scale_x_date()?

image

thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.