Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewriting control charts #288

Merged
merged 56 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
fb89289
Create combined function template
JTPetter Jul 14, 2023
a622067
Rewrite continued up including table
JTPetter Jul 17, 2023
f548578
Continue rewrite
JTPetter Jul 18, 2023
02054ed
Finish rewriting function v1
JTPetter Jul 19, 2023
d7b2e55
Start implementing stages for subgroups
JTPetter Jul 24, 2023
27e8949
Continue implementation of stages in subgroups
JTPetter Jul 24, 2023
7c5ff45
Add stages for subgroups with long format
JTPetter Jul 26, 2023
779cc68
Add footnote about stages x subgroups calculation
JTPetter Jul 31, 2023
45b47af
Fix errors with certain subgroup sizes
JTPetter Aug 7, 2023
bdf67d4
Fix plots breaking when single subgroup
JTPetter Aug 8, 2023
94a0335
Fix x axis in subgroups charts sometimes displaying NAs
JTPetter Aug 8, 2023
052cee9
Fix half labels and handling of subgroup sizes == 1
JTPetter Aug 10, 2023
19b900a
Fix handling of subgroups with single observation
JTPetter Aug 12, 2023
8b78cad
Offset for geom_step
JTPetter Aug 14, 2023
a39bc79
Stage labels and fixes
JTPetter Aug 15, 2023
78d6a5f
Finalize stages labels
JTPetter Aug 17, 2023
c9f04bd
Fix I and MR charts
JTPetter Aug 18, 2023
dfa0711
Start replacing control chart functions in gaugeRR with new function
JTPetter Aug 22, 2023
74f6714
Replace and remove old control chart functions in gauge studies
JTPetter Aug 23, 2023
8131e37
Replace and remove xbar- and r-chart everywhere
JTPetter Aug 24, 2023
241e0e7
Replace IMR function in individual charts analysis
JTPetter Aug 25, 2023
112a68d
Add radio button in PCA to switch between xbar and imr chart
JTPetter Aug 28, 2023
f5175cb
Replace IMR chart function everywhere and remove
JTPetter Sep 4, 2023
89d186e
Fix dependencies of control charts in PCA
JTPetter Sep 5, 2023
d7b9270
Bugfixes and displaying of lables in table
JTPetter Oct 6, 2023
625de6c
Some bugfixes and visual improvements
JTPetter Oct 9, 2023
b47f189
Missing value handling for individual charts and bugfixes
JTPetter Oct 10, 2023
07c54cf
Update helpfile and handling of missing values in stages and subgroups
JTPetter Oct 11, 2023
2b42b51
Stages chart option to calculate across whole df
JTPetter Oct 16, 2023
10a3256
Naming, capitalization, little tweaks
JTPetter Oct 16, 2023
5ddca54
Dynamic naming of x-axis title for all control charts
JTPetter Oct 17, 2023
7980991
Renaming of control chart report titles
JTPetter Oct 17, 2023
6265d49
Control chart reports improvements
JTPetter Oct 18, 2023
473f8b6
Option to calc with fixed subgroup size for subgroup chart
JTPetter Oct 18, 2023
8fb1394
Restructuring with subfuctions part 1
JTPetter Oct 18, 2023
e2c71b9
Restructuring 2
JTPetter Oct 22, 2023
f051716
Template for unit tests
JTPetter Oct 22, 2023
cd48f35
Basic test for var charts subgroups
JTPetter Oct 23, 2023
3a41b6c
Fix existing unit tests that used control charts and created images f…
JTPetter Oct 24, 2023
aa3caa8
Fix merge conflicts
JTPetter Oct 26, 2023
b9656d4
Fix unit tests after rebase
JTPetter Oct 27, 2023
a2e27c7
s-chart unbiasing constant and updated tests
JTPetter Oct 29, 2023
ffa5a74
Finalize unit tests for subgroups long format
JTPetter Oct 31, 2023
8150f83
Basic tests for subgroups wide format
JTPetter Oct 31, 2023
c9b3192
Finalize unit tests for subgroup charts
JTPetter Oct 31, 2023
6c4e96c
Finalize unit tests for individual charts
JTPetter Nov 2, 2023
cc75321
Upgrade
JTPetter Nov 3, 2023
b1980df
Remove testing code
JTPetter Nov 3, 2023
fa897c2
Fix i18n tests
JTPetter Nov 8, 2023
a020e23
Skip test that fails on Linux
JTPetter Nov 8, 2023
2367e16
Forget to rename line and remove unused snap
JTPetter Nov 9, 2023
c66219e
Rebase and accept changed unit tests from previously merged PR
JTPetter Nov 11, 2023
7a1ef6a
Sensible error message when all subgroups are size 1
JTPetter Nov 11, 2023
dc8534d
Disable CUMSUM chart, wrong results
JTPetter Nov 15, 2023
514d53e
Include subgroups sizes smaller than 1 in error message
JTPetter Nov 16, 2023
f9eb2b6
FIX: Include subgroup sizes smaller than 1 in error message
JTPetter Nov 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions R/attributesCharts.R
Original file line number Diff line number Diff line change
Expand Up @@ -739,3 +739,82 @@ attributesCharts <- function(jaspResults, dataset, options) {

return(matrixPlot)
}

.NelsonTable <- function(dataset, options, sixsigma, type = "xbar", Phase2 = TRUE, name = "X-bar", xLabels = NULL) {

table <- createJaspTable(title = gettextf("Test results for %s chart", name))

if (length(sixsigma$statistics) == 1) # no need for table with only 1 group
return(table)

if (!Phase2 || type == "xbar.one") {

Test <- NelsonLaws(data = sixsigma, allsix = TRUE, xLabels = xLabels)

if (length(Test$Rules$R1) > 0)
table$addColumnInfo(name = "test1", title = gettextf("Test 1: Beyond limit") , type = "integer")

if (length(Test$Rules$R2) > 0)
table$addColumnInfo(name = "test2", title = gettextf("Test 2: Shift") , type = "integer")

if (length(Test$Rules$R3) > 0)
table$addColumnInfo(name = "test3", title = gettextf("Test 3: Trend") , type = "integer")

if (length(Test$Rules$R4) > 0)
table$addColumnInfo(name = "test4", title = gettextf("Test 4: Increasing variation") , type = "integer")

if (length(Test$Rules$R5) > 0)
table$addColumnInfo(name = "test5", title = gettextf("Test 5: Reducing variation") , type = "integer")

if (length(Test$Rules$R6) > 0)
table$addColumnInfo(name = "test6", title = gettextf("Test 6: Bimodal distribution") , type = "integer")



table$setData(list(
"test1" = c(Test$Rules$R1),
"test2" = c(Test$Rules$R2),
"test3" = c(Test$Rules$R3),
"test4" = c(Test$Rules$R4),
"test5" = c(Test$Rules$R5),
"test6" = c(Test$Rules$R6)
))

}
else {

if (name == "np" || name == "c" || name == "u" || name == "Laney p'" || name == "Laney u'")
Test <- NelsonLaws(data = sixsigma, xLabels = xLabels, chart = "c")
else if (name == "P")
Test <- NelsonLaws(data = sixsigma, xLabels = xLabels, chart = "p")
else
Test <- NelsonLaws(data = sixsigma, xLabels = xLabels)

if (length(Test$Rules$R1) > 0)
table$addColumnInfo(name = "test1", title = gettextf("Test 1: Beyond limit") , type = "integer")

if (length(Test$Rules$R2) > 0)
table$addColumnInfo(name = "test2", title = gettextf("Test 2: Shift") , type = "integer")

if (length(Test$Rules$R3) > 0)
table$addColumnInfo(name = "test3", title = gettextf("Test 3: Trend") , type = "integer")

if (type == "Range" & length(xLabels) == 0){
table$setData(list(
"test1" = c(Test$Rules$R1 + 1),
"test2" = c(Test$Rules$R2 + 1),
"test3" = c(Test$Rules$R3 + 1)
))
} else{
table$setData(list(
"test1" = c(Test$Rules$R1),
"test2" = c(Test$Rules$R2),
"test3" = c(Test$Rules$R3)
))
}
}

table$showSpecifiedColumnsOnly <- TRUE
table$addFootnote(message = gettext("Points where a test failed."))
return(table)
}
Loading
Loading