Skip to content

Commit a6db73d

Browse files
committed
Fix tests
1 parent a175f84 commit a6db73d

File tree

16 files changed

+37
-48
lines changed

16 files changed

+37
-48
lines changed

.Rproj.user/CB2BA49E/pcs/files-pane.pper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"ascending": true
66
}
77
],
8-
"path": "~/Documents/ReliaGrowR/tests/testthat"
8+
"path": "~/Documents/ReliaGrowR/R"
99
}

R/duane.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#' Duane Analysis
32
#'
43
#' This function performs a Duane analysis (1962) <doi:10.1109/TA.1964.4319640>
@@ -52,8 +51,7 @@
5251
#' @srrstats {G5.9a} Unit tests check that adding trivial noise to data does not meaningfully change results.
5352
#' @srrstats {G5.9b} Unit tests check that different random seeds do not meaningfully change results.
5453
#' @srrstats {G5.10} All unit tests run as part of continuous integration.
55-
#' @srrstats {RE1.2] Documentation includes expected format for inputting predictor variables
56-
#' (`times`, `failures`).
54+
#' @srrstats {RE1.2} Documentation includes expected format for inputting predictor variables (`times`, `failures`).
5755
#' @srrstats {RE1.3} Output retains all relevant aspects of input data.
5856
#' @srrstats {RE1.3a} Output retains all relevant aspects of input data.
5957
#' @srrstats {RE1.4} Documentation includes assumptions for the input data (i.e., positive, finite values).

R/gof.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#' Q-Q Plot for RGA Objects
32
#'
43
#' This function creates a Q-Q plot for a fitted Reliability Growth Analysis (RGA) model
@@ -149,5 +148,3 @@ ppplot.rga <- function(x,
149148
# 45-degree reference line
150149
abline(lsfit(theo_cdf, emp_cdf))
151150
}
152-
153-

R/rdt.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#' Reliability Demonstration Test (RDT) Plan Calculator
32
#'
43
#' This function calculates the required test time or sample size for a Reliability

R/rga.R

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#' Reliability Growth Analysis.
32
#'
43
#' This function performs reliability growth analysis using the Crow-AMSAA model by
@@ -58,8 +57,7 @@
5857
#' @srrstats {G5.9a} Unit tests check that adding trivial noise to data does not meaningfully change results.
5958
#' @srrstats {G5.9b} Unit tests check that different random seeds do not meaningfully change results.
6059
#' @srrstats {G5.10} All unit tests run as part of continuous integration.
61-
#' @srrstats {RE1.2] Documentation includes expected format for inputting predictor variables
62-
#' (`times`, `failures`).
60+
#' @srrstats {RE1.2} Documentation includes expected format for inputting predictor variables (`times`, `failures`).
6361
#' @srrstats {RE1.3} Output retains all relevant aspects of input data.
6462
#' @srrstats {RE1.3a} Output retains all relevant aspects of input data.
6563
#' @srrstats {RE1.4} Documentation includes assumptions for the input data (i.e., positive, finite values).
@@ -93,7 +91,7 @@
9391
#' @srrstats {RE7.2} Unit tests demonstrate that output objects retain aspects
9492
#' of input data such as case names.
9593
#' @srrstats {RE7.3} Unit tests demonstrate expected behavior when `rga` object
96-
#'is submitted to the accessor methods `print` and `plot`.
94+
#' is submitted to the accessor methods `print` and `plot`.
9795
#'
9896
#' @param times Either a numeric vector of cumulative failure times or a data frame
9997
#' containing both failure times and failure counts. If a data frame is provided, it must
@@ -228,7 +226,7 @@ rga <- function(times, failures, model_type = "Crow-AMSAA", breaks = NULL, conf_
228226
# Check for perfect collinearity
229227
cor_val <- suppressWarnings(cor(log_times, log_cum_failures))
230228
if (is.na(cor_val) || abs(cor_val - 1) < .Machine$double.eps^0.5 ||
231-
abs(cor_val + 1) < .Machine$double.eps^0.5) {
229+
abs(cor_val + 1) < .Machine$double.eps^0.5) {
232230
stop("Perfect collinearity detected between predictor ('log_times') and response ('log_cum_failures'). Regression cannot be performed.")
233231
}
234232

R/srr-stats-standards.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#' NA_standards
32
#'
43
#' @srrstatsNA {G1.4a} There are no internal (non-exported) functions.

R/testdata.r

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#' Reliability Test Data
32
#'
43
#' A dataset containing example reliability test data from the military report

R/weibull_to_rga.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#' Weibull to RGA
32
#'
43
#' Converts Weibull data (failure, suspension, and interval-censored times)
@@ -144,5 +143,3 @@ weibull_to_rga <- function(failures,
144143

145144
return(result)
146145
}
147-
148-

data-raw/TESTDATA.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#' @srrstats {G5.0} The data set is a standard data set from a published paper.
32
#' @srrstats {G5.1} The data set is created within and used to test the package.
43
#' The data set is exported so that users can confirm tests and run examples.

tests/testthat/Rplots.pdf

8.24 KB
Binary file not shown.

0 commit comments

Comments
 (0)