Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a stat_mR() added Stat_QC(method = mR)
- Loading branch information
1 parent
ca0b746
commit 0239ef7
Showing
8 changed files
with
176 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Stat_MR <- ggplot2::ggproto("Stat_MR", ggplot2::Stat, | ||
compute_group = function(data, scales){ | ||
#suppressWarnings() | ||
mRs3<- mR_points_gg(data = data, value = "y", grouping = "x") | ||
mRs <- data.frame(y=mRs3, x=data$x) | ||
#mRs | ||
|
||
} | ||
|
||
) | ||
|
||
|
||
stat_mR <- function(mapping = NULL, | ||
data = NULL, | ||
geom = "point", | ||
yintercept = NULL, | ||
position = "identity", | ||
na.rm = FALSE, | ||
show.legend = NA, | ||
inherit.aes = TRUE, | ||
...) { | ||
|
||
ggplot2::layer( | ||
stat = Stat_MR, | ||
#yintercept=XBar, | ||
data = data, | ||
mapping = mapping, | ||
geom = geom, | ||
position = position, | ||
show.legend = show.legend, | ||
inherit.aes = inherit.aes, | ||
params = list(na.rm = na.rm, ...) | ||
) | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Future Functions | ||
|
||
#Want to build up for a 3 way control chart. see wheeler_USPC pg. 222 | ||
|
||
#Right now the mR function only works if the data one dimentional. | ||
# mR_points_future <- function(y, data=NULL, formula = NULL){ | ||
# if(is.null(formula)) { | ||
# return(c(NA, abs(diff(y)))) | ||
# } | ||
# aggTemp <- aggregate(formula, data=data, FUN=mean) | ||
# return(c(NA, abs(diff(aggTemp[, ncol(aggTemp)])))) | ||
# } | ||
|
||
# # mR for three way plot --------------------------------------------------- | ||
# #Not ready for this think need special stat | ||
# ggmR <- ggplot(Wheeler108, aes(x=Hour, y=value, group=1)) + | ||
# #geom_point() + #geom_line() + | ||
# #geom_line(aes(group=interaction(Hour,PressCycle))) + | ||
# #geom_line(data = Wheeler108, aes(group=as.factor(Hour))) + | ||
# stat_summary(fun.y = "mR_points", | ||
# #fun.args = list(data=Wheeler108, | ||
# # formula=value~Cavity+Hour), | ||
# colour = "red", size = 1, geom = c("line") )+ | ||
# stat_summary(fun.y = "mR_points", | ||
# #fun.args = list(data=Wheeler108, | ||
# # formula=value~Cavity+Hour), | ||
# colour = "red", size = 2, geom = c("point"))+ | ||
# stat_QC(digits = 2, method = "sBar") + | ||
# stat_QC_labels(digits = 2, method = "sBar") + | ||
# theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + | ||
# facet_grid(.~Cavity, scales = "free_x") # + theme_bw() | ||
# | ||
# ggmR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters