From 818de681ddacdf3be06fd292f965a3cca858118e Mon Sep 17 00:00:00 2001 From: Anil Tellbuescher Date: Sat, 16 Nov 2024 13:34:09 +0100 Subject: add linearity tests for calibration data --- R/linearity.R | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 R/linearity.R diff --git a/R/linearity.R b/R/linearity.R new file mode 100644 index 0000000..6230d04 --- /dev/null +++ b/R/linearity.R @@ -0,0 +1,113 @@ +#' Assess the linearity of a calibration curve +#' +#' A function to create diagnostic plots for the assessment of the linearity of +#' calibration data based on their point-to-point slope or the curvature. +#' The underlying methods follow ISO 84 66-1:2021 and DIN 32 402-51:2017 +#' (German Industrial Norm). +#' +#' The point-to-point slope method is based on the assumption that the slope +#' between two points should not vary greatly within the linear range. +#' +#' The curvature method is similar to the point-to-point slope method. Here, +#' the ratio between the instrument signal and the concentration of the +#' calibration standard is assumed not to vary greatly within the linear range. +#' +#' The use of the Mandel test is discouraged due to its limitations in the +#' identification of non-linear behaviour of calibration courves (Andrade and +#' Gomes-Carracedo, 2013). +#' +#' @param x numeric vector of independent values (usually concentrations). +#' @param y numeric vector of dependent values (usually the signal of the +#' analytical device). +#' @param method character string. Supported methods are "slope" and +#' "curvature". +#' @param tolerance numeric value describing the acceptable deviation from the +#' median of the slopes or the signal-to-concentration ratio. The default +#' tolerance is 10%. +#' @return returns a diagnostic plot +#' +#' @author Anil Axel Tellbüscher +#' +#' @importFrom graphics abline +#' @importFrom stats median +#' +#' @examples +#' # Point-to-point slope plot +#' linearity(din32645$x, din32645$y, method = "slope") +#' +#' # Curvature plot +#' linearity(din32645$x, din32645$y, method = "curvature", tolerance = 0.2) +#' +#' @references ISO 8466-1:2021. Water quality — Calibration and evaluation of +#' analytical methods — Part 1: Linear calibration function +#' +#' J. M. Andrade and M. P. Gomez-Carracedo (2013) Notes on the use of +#' Mandel's test to check for nonlinearity in laboratory calibrations. +#' Analytical Methods 5(5), 1145 - 1149. +#' +#' @export +# Function to assess linearity of data using either slope or curvature method +linearity <- function(x, y, method = NULL, tolerance = 0.1) { + + # Check data integrity + # Ensure that x and y vectors have the same length + stopifnot("x and y must have the same length!" = length(x) == length(y)) + + # Ensure that a method has been specified + stopifnot("Method must be defined!\n + Select either 'slope' for the point-to-point slope or 'curvature' + for the empirical curvature test" = + !is.null(method)) + + # Validate that the method is either 'slope' or 'curvature' + stopifnot("Invalid input!\n + Select either 'slope' for the point-to-point slope or 'curvature' + for the empirical curvature test" = + method %in% c("slope", "curvature")) + + # Calculate the 'result' based on the chosen method + if (method == "slope") { + # For the 'slope' method, calculate the difference between consecutive points + x_diff = diff(x) # Difference in x values + y_diff = diff(y) # Difference in y values + result = y_diff / x_diff # Point-to-point slope (rate of change) + } else if (method == "curvature") { + # For the 'curvature' method, calculate the signal-to-concentration ratio + result = y / x # Element-wise division of y by x + } + + # Calculate the median of the results for tolerance check + result_median <- median(result) + + # Define upper and lower tolerance boundaries + upper_tolerance <- result_median + tolerance * result_median + lower_tolerance <- result_median - tolerance * result_median + + # Create a data frame to store the result and corresponding indices + df <- data.frame(result = result, index = 1:length(result)) + + # Identify points that fall outside the tolerance range + outside_tolerance <- rbind( + subset(df, result > upper_tolerance), # Points above the upper tolerance + subset(df, result < lower_tolerance) # Points below the lower tolerance + ) + + # Basic scatter plot of the result against the index + plot(result ~ index, data = df, + main = "linearity assessment", ylab = method, + pch = 16) + + # Draw a line connecting all the points to visualize the trend + lines(df$index, df$result, col = "blue") # Blue line connecting points + + # Highlight points that are outside the tolerance range in red + points(x = outside_tolerance$index, y = outside_tolerance$result, + pch = 16, col = "red") + + # Add a horizontal line at the median value of the result + abline(h = result_median, col = "red") + + # Add dashed horizontal lines at the upper and lower tolerance limits + abline(h = upper_tolerance, col = "red", lty = 3) # Upper tolerance + abline(h = lower_tolerance, col = "red", lty = 3) # Lower tolerance +} -- cgit v1.2.1 From 1dc4318a30b34ebbf21472d29dbe341f22bc3ea2 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Sun, 17 Nov 2024 14:57:04 +0100 Subject: Use match.arg for checking method argument --- R/linearity.R | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/R/linearity.R b/R/linearity.R index 6230d04..759b288 100644 --- a/R/linearity.R +++ b/R/linearity.R @@ -13,7 +13,7 @@ #' calibration standard is assumed not to vary greatly within the linear range. #' #' The use of the Mandel test is discouraged due to its limitations in the -#' identification of non-linear behaviour of calibration courves (Andrade and +#' identification of non-linear behaviour of calibration curves (Andrade and #' Gomes-Carracedo, 2013). #' #' @param x numeric vector of independent values (usually concentrations). @@ -21,9 +21,9 @@ #' analytical device). #' @param method character string. Supported methods are "slope" and #' "curvature". -#' @param tolerance numeric value describing the acceptable deviation from the -#' median of the slopes or the signal-to-concentration ratio. The default -#' tolerance is 10%. +#' @param tolerance numeric value between 0 and 1, describing the acceptable +#' deviation from the median of the slopes or the signal-to-concentration +#' ratio. The default tolerance is 10%. #' @return returns a diagnostic plot #' #' @author Anil Axel Tellbüscher @@ -32,6 +32,7 @@ #' @importFrom stats median #' #' @examples +#' data(din32645) #' # Point-to-point slope plot #' linearity(din32645$x, din32645$y, method = "slope") #' @@ -47,23 +48,13 @@ #' #' @export # Function to assess linearity of data using either slope or curvature method -linearity <- function(x, y, method = NULL, tolerance = 0.1) { +linearity <- function(x, y, method = c("slope", "curvature"), tolerance = 0.1) { # Check data integrity # Ensure that x and y vectors have the same length stopifnot("x and y must have the same length!" = length(x) == length(y)) - # Ensure that a method has been specified - stopifnot("Method must be defined!\n - Select either 'slope' for the point-to-point slope or 'curvature' - for the empirical curvature test" = - !is.null(method)) - - # Validate that the method is either 'slope' or 'curvature' - stopifnot("Invalid input!\n - Select either 'slope' for the point-to-point slope or 'curvature' - for the empirical curvature test" = - method %in% c("slope", "curvature")) + method <- match.arg(method) # Calculate the 'result' based on the chosen method if (method == "slope") { -- cgit v1.2.1 From ab87412a265039b58a59ad063def78b8aa8dfa31 Mon Sep 17 00:00:00 2001 From: Anil Tellbuescher Date: Sat, 11 Jan 2025 13:37:27 +0100 Subject: add .Rproj file --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index b752ef4..1bee8d8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ chemCal.Rcheck chemCal_*.tar.gz experimental +.Rproj.user +.Rhistory +*.Rproj -- cgit v1.2.1 From a2cc5039c5c4df712d2a80d0c5e87acb4b243616 Mon Sep 17 00:00:00 2001 From: Anil Tellbuescher Date: Sat, 11 Jan 2025 13:38:07 +0100 Subject: import graphics::lines --- NAMESPACE | 4 ++++ R/linearity.R | 1 + 2 files changed, 5 insertions(+) diff --git a/NAMESPACE b/NAMESPACE index 5f98a2a..95e274b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -11,12 +11,16 @@ S3method(loq,default) S3method(loq,lm) export(calplot) export(inverse.predict) +export(linearity) export(lod) export(loq) +importFrom(graphics,abline) importFrom(graphics,legend) +importFrom(graphics,lines) importFrom(graphics,matlines) importFrom(graphics,plot) importFrom(graphics,points) +importFrom(stats,median) importFrom(stats,optimize) importFrom(stats,predict) importFrom(stats,qt) diff --git a/R/linearity.R b/R/linearity.R index 759b288..8970fe7 100644 --- a/R/linearity.R +++ b/R/linearity.R @@ -29,6 +29,7 @@ #' @author Anil Axel Tellbüscher #' #' @importFrom graphics abline +#' @importFrom graphics lines #' @importFrom stats median #' #' @examples -- cgit v1.2.1 From de43d24f4e770ad2412da21214d5790790835e66 Mon Sep 17 00:00:00 2001 From: Anil Tellbuescher Date: Sat, 11 Jan 2025 13:39:59 +0100 Subject: add .Rproj file --- .Rbuildignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.Rbuildignore b/.Rbuildignore index f84e599..7fdd16c 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -11,3 +11,5 @@ experimental test.log$ ^codecov\.yml$ ^\.github$ +^.*\.Rproj$ +^\.Rproj\.user$ -- cgit v1.2.1 From 0e44aa36a796c7f2952000f2df7d02bb249f4e9c Mon Sep 17 00:00:00 2001 From: Anil Tellbuescher Date: Sat, 11 Jan 2025 13:40:33 +0100 Subject: add example calibration data from DIN 38402 --- R/chemCal-package.R | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++ data/din38402b1.rda | Bin 0 -> 332 bytes data/din38402b3.rda | Bin 0 -> 274 bytes data/din38402b6.rda | Bin 0 -> 269 bytes data/din38402c3.rda | Bin 0 -> 272 bytes man/din38402b1.Rd | 20 ++++++++++++++ man/din38402b3.Rd | 21 +++++++++++++++ man/din38402b6.Rd | 20 ++++++++++++++ man/din38402c3.Rd | 19 ++++++++++++++ man/linearity.Rd | 62 +++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 216 insertions(+) create mode 100644 data/din38402b1.rda create mode 100644 data/din38402b3.rda create mode 100644 data/din38402b6.rda create mode 100644 data/din38402c3.rda create mode 100644 man/din38402b1.Rd create mode 100644 man/din38402b3.Rd create mode 100644 man/din38402b6.Rd create mode 100644 man/din38402c3.Rd create mode 100644 man/linearity.Rd diff --git a/R/chemCal-package.R b/R/chemCal-package.R index 8cc8c76..08c2ebc 100644 --- a/R/chemCal-package.R +++ b/R/chemCal-package.R @@ -192,3 +192,77 @@ NULL + + +#' Nitrite calibration data +#' +#' Example dataset B.1 from DIN 38402 with concentrations in µg/L and the extinction +#' as response measured using continuous flow analysis (CFA) according to +#' ISO 13395. +#' +#' @name din38402b1 +#' @docType data +#' @format A tibble containing 12 concentration levels with the respective +#' instrument response values. +#' @references DIN 38402-51:2017-05, Beuth Verlag, Berlin. +#' https://dx.doi.org/10.31030/2657448 +#' @keywords datasets +NULL + + + + + +#' Copper calibration data +#' +#' Example dataset B.3 from DIN 38402. Cu was measured according to ISO 11885, +#' using ICP-OES. The concentration are reported in mg/L and the response as +#' counts/s, describing the count of photons that are detected by the +#' photomultiplier detector of the device. +#' +#' @name din38402b3 +#' @docType data +#' @format A tibble containing 13 concentration levels and the respective +#' instrument response values. +#' @references DIN 38402-51:2017-05, Beuth Verlag, Berlin. +#' https://dx.doi.org/10.31030/2657448 +#' @keywords datasets +NULL + + + + + +#' Carbamazepin calibration data +#' +#' Example dataset B.6 from DIN 38402 measured using LC-MS/MS. The +#' concentrations are reported in in µg/L and the response in arbitrary +#' units (AU). +#' +#' @name din38402b6 +#' @docType data +#' @format A tibble containing 12 concentration levels and the respective +#' instrument response values. +#' @references DIN 38402-51:2017-05, Beuth Verlag, Berlin. +#' https://dx.doi.org/10.31030/2657448 +#' @keywords datasets +NULL + + + + + +#' Iron calibration data +#' +#' Example dataset C.3 from DIN 38402 determined by ion chromatography. +#' Concentrations are reported in mg/L and the extinction as response. +#' +#' @name din38402c3 +#' @docType data +#' @format A tibble containing 10 concentration levels and the respective +#' response values. +#' @references DIN 38402-51:2017-05, Beuth Verlag, Berlin. +#' https://dx.doi.org/10.31030/2657448 +#' @keywords datasets +NULL + diff --git a/data/din38402b1.rda b/data/din38402b1.rda new file mode 100644 index 0000000..9436f8a Binary files /dev/null and b/data/din38402b1.rda differ diff --git a/data/din38402b3.rda b/data/din38402b3.rda new file mode 100644 index 0000000..699c76b Binary files /dev/null and b/data/din38402b3.rda differ diff --git a/data/din38402b6.rda b/data/din38402b6.rda new file mode 100644 index 0000000..3b81120 Binary files /dev/null and b/data/din38402b6.rda differ diff --git a/data/din38402c3.rda b/data/din38402c3.rda new file mode 100644 index 0000000..7e83cf6 Binary files /dev/null and b/data/din38402c3.rda differ diff --git a/man/din38402b1.Rd b/man/din38402b1.Rd new file mode 100644 index 0000000..10ccddc --- /dev/null +++ b/man/din38402b1.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/chemCal-package.R +\docType{data} +\name{din38402b1} +\alias{din38402b1} +\title{Nitrite calibration data} +\format{ +A tibble containing 12 concentration levels with the respective +instrument response values. +} +\description{ +Example dataset B.1 from DIN 38402 with concentrations in µg/L and the extinction +as response measured using continuous flow analysis (CFA) according to +ISO 13395. +} +\references{ +DIN 38402-51:2017-05, Beuth Verlag, Berlin. +https://dx.doi.org/10.31030/2657448 +} +\keyword{datasets} diff --git a/man/din38402b3.Rd b/man/din38402b3.Rd new file mode 100644 index 0000000..b4b5504 --- /dev/null +++ b/man/din38402b3.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/chemCal-package.R +\docType{data} +\name{din38402b3} +\alias{din38402b3} +\title{Copper calibration data} +\format{ +A tibble containing 13 concentration levels and the respective +instrument response values. +} +\description{ +Example dataset B.3 from DIN 38402. Cu was measured according to ISO 11885, +using ICP-OES. The concentration are reported in mg/L and the response as +counts/s, describing the count of photons that are detected by the +photomultiplier detector of the device. +} +\references{ +DIN 38402-51:2017-05, Beuth Verlag, Berlin. +https://dx.doi.org/10.31030/2657448 +} +\keyword{datasets} diff --git a/man/din38402b6.Rd b/man/din38402b6.Rd new file mode 100644 index 0000000..feb3577 --- /dev/null +++ b/man/din38402b6.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/chemCal-package.R +\docType{data} +\name{din38402b6} +\alias{din38402b6} +\title{Carbamazepin calibration data} +\format{ +A tibble containing 12 concentration levels and the respective +instrument response values. +} +\description{ +Example dataset B.6 from DIN 38402 measured using LC-MS/MS. The +concentrations are reported in in µg/L and the response in arbitrary +units (AU). +} +\references{ +DIN 38402-51:2017-05, Beuth Verlag, Berlin. +https://dx.doi.org/10.31030/2657448 +} +\keyword{datasets} diff --git a/man/din38402c3.Rd b/man/din38402c3.Rd new file mode 100644 index 0000000..7c00999 --- /dev/null +++ b/man/din38402c3.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/chemCal-package.R +\docType{data} +\name{din38402c3} +\alias{din38402c3} +\title{Iron calibration data} +\format{ +A tibble containing 10 concentration levels and the respective +response values. +} +\description{ +Example dataset C.3 from DIN 38402 determined by ion chromatography. +Concentrations are reported in mg/L and the extinction as response. +} +\references{ +DIN 38402-51:2017-05, Beuth Verlag, Berlin. +https://dx.doi.org/10.31030/2657448 +} +\keyword{datasets} diff --git a/man/linearity.Rd b/man/linearity.Rd new file mode 100644 index 0000000..aa3d857 --- /dev/null +++ b/man/linearity.Rd @@ -0,0 +1,62 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/linearity.R +\name{linearity} +\alias{linearity} +\title{Assess the linearity of a calibration curve} +\usage{ +linearity(x, y, method = c("slope", "curvature"), tolerance = 0.1) +} +\arguments{ +\item{x}{numeric vector of independent values (usually concentrations).} + +\item{y}{numeric vector of dependent values (usually the signal of the +analytical device).} + +\item{method}{character string. Supported methods are "slope" and +"curvature".} + +\item{tolerance}{numeric value between 0 and 1, describing the acceptable +deviation from the median of the slopes or the signal-to-concentration +ratio. The default tolerance is 10\%.} +} +\value{ +returns a diagnostic plot +} +\description{ +A function to create diagnostic plots for the assessment of the linearity of +calibration data based on their point-to-point slope or the curvature. +The underlying methods follow ISO 84 66-1:2021 and DIN 32 402-51:2017 +(German Industrial Norm). +} +\details{ +The point-to-point slope method is based on the assumption that the slope +between two points should not vary greatly within the linear range. + +The curvature method is similar to the point-to-point slope method. Here, +the ratio between the instrument signal and the concentration of the +calibration standard is assumed not to vary greatly within the linear range. + +The use of the Mandel test is discouraged due to its limitations in the +identification of non-linear behaviour of calibration curves (Andrade and +Gomes-Carracedo, 2013). +} +\examples{ +data(din32645) +# Point-to-point slope plot +linearity(din32645$x, din32645$y, method = "slope") + +# Curvature plot +linearity(din32645$x, din32645$y, method = "curvature", tolerance = 0.2) + +} +\references{ +ISO 8466-1:2021. Water quality — Calibration and evaluation of +analytical methods — Part 1: Linear calibration function + +J. M. Andrade and M. P. Gomez-Carracedo (2013) Notes on the use of +Mandel's test to check for nonlinearity in laboratory calibrations. +Analytical Methods 5(5), 1145 - 1149. +} +\author{ +Anil Axel Tellbüscher +} -- cgit v1.2.1 From cfcd58348dc8cbf7010231bfe902867bb30a8b3f Mon Sep 17 00:00:00 2001 From: Anil Tellbuescher Date: Sat, 11 Jan 2025 13:56:17 +0100 Subject: replace din32645 data by data from din38402b1 --- R/linearity.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/R/linearity.R b/R/linearity.R index 8970fe7..8a4f09b 100644 --- a/R/linearity.R +++ b/R/linearity.R @@ -26,19 +26,21 @@ #' ratio. The default tolerance is 10%. #' @return returns a diagnostic plot #' -#' @author Anil Axel Tellbüscher +#' @author Anıl Axel Tellbüscher #' #' @importFrom graphics abline #' @importFrom graphics lines #' @importFrom stats median #' #' @examples -#' data(din32645) +#' # Continuous Flow Analysis (CFA) data +#' data(din38402b1) +#' #' # Point-to-point slope plot -#' linearity(din32645$x, din32645$y, method = "slope") +#' linearity(din38402b1$conc, din38402b1$ext, method = "slope") #' #' # Curvature plot -#' linearity(din32645$x, din32645$y, method = "curvature", tolerance = 0.2) +#' linearity(din38402b1$conc, din38402b1$ext, method = "curvature") #' #' @references ISO 8466-1:2021. Water quality — Calibration and evaluation of #' analytical methods — Part 1: Linear calibration function -- cgit v1.2.1 From c7b841c93dc2f3228dfe65ebd3bdd7a7f546fb96 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 22 Jan 2025 17:14:04 +0100 Subject: Satisfy R CMD check - Depend on R >= 3.5.0, because the format used for the data is not known to earlier R versions - Rename the datasets from `test` to their proper name --- DESCRIPTION | 3 ++- R/chemCal-package.R | 20 ++++++++++---------- check.log | 29 +++++++++++++++-------------- data/din38402b1.rda | Bin 332 -> 337 bytes data/din38402b3.rda | Bin 274 -> 281 bytes data/din38402b6.rda | Bin 269 -> 275 bytes data/din38402c3.rda | Bin 272 -> 277 bytes man/din32645.Rd | 3 +++ man/din38402b1.Rd | 3 +++ man/din38402b3.Rd | 3 +++ man/din38402b6.Rd | 3 +++ man/din38402c3.Rd | 3 +++ man/linearity.Rd | 10 ++++++---- man/massart97ex1.Rd | 3 +++ man/massart97ex3.Rd | 3 +++ man/rl95_cadmium.Rd | 3 +++ man/rl95_toluene.Rd | 3 +++ man/utstats14.Rd | 3 +++ 18 files changed, 63 insertions(+), 29 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2b680b9..de910c5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,10 +1,11 @@ Package: chemCal Version: 0.2.3.9000 -Date: 2024-11-17 +Date: 2025-01-25 Title: Calibration Functions for Analytical Chemistry Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "johannes.ranke@jrwb.de", comment = c(ORCID = "0000-0003-4371-6538"))) +Depends: R (>= 3.5.0) Suggests: MASS, knitr, testthat, investr, covr, rmarkdown Description: Simple functions for plotting linear calibration functions and estimating standard errors for measurements diff --git a/R/chemCal-package.R b/R/chemCal-package.R index 08c2ebc..54ab190 100644 --- a/R/chemCal-package.R +++ b/R/chemCal-package.R @@ -54,7 +54,7 @@ #' # LQ = 3.04 * LC (Currie 1999, p. 120) #' 3.04 * lod(m, alpha = 0.01, beta = 0.5)$x #' -NULL +"din32645" @@ -72,7 +72,7 @@ NULL #' Lewi, P.J., Smeyers-Verbeke, J. (1997) Handbook of Chemometrics and #' Qualimetrics: Part A, Chapter 8. #' @keywords datasets -NULL +"massart97ex1" @@ -128,7 +128,7 @@ NULL #' # of 15, but the graphical procedure of Massart (p. 201) to derive the #' # variances on which the weights are based is quite inaccurate anyway. #' -NULL +"massart97ex3" @@ -147,7 +147,7 @@ NULL #' @source Rocke, David M. und Lorenzato, Stefan (1995) A two-component model #' for measurement error in analytical chemistry. Technometrics 37(2), 176-184. #' @keywords datasets -NULL +"rl95_cadmium" @@ -167,7 +167,7 @@ NULL #' @source Rocke, David M. und Lorenzato, Stefan (1995) A two-component model #' for measurement error in analytical chemistry. Technometrics 37(2), 176-184. #' @keywords datasets -NULL +"rl95_toluene" @@ -188,7 +188,7 @@ NULL #' Toronto. #' \url{https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/index.html} #' @keywords datasets -NULL +"utstats14" @@ -207,7 +207,7 @@ NULL #' @references DIN 38402-51:2017-05, Beuth Verlag, Berlin. #' https://dx.doi.org/10.31030/2657448 #' @keywords datasets -NULL +"din38402b1" @@ -227,7 +227,7 @@ NULL #' @references DIN 38402-51:2017-05, Beuth Verlag, Berlin. #' https://dx.doi.org/10.31030/2657448 #' @keywords datasets -NULL +"din38402b3" @@ -246,7 +246,7 @@ NULL #' @references DIN 38402-51:2017-05, Beuth Verlag, Berlin. #' https://dx.doi.org/10.31030/2657448 #' @keywords datasets -NULL +"din38402b6" @@ -264,5 +264,5 @@ NULL #' @references DIN 38402-51:2017-05, Beuth Verlag, Berlin. #' https://dx.doi.org/10.31030/2657448 #' @keywords datasets -NULL +"din38402c3" diff --git a/check.log b/check.log index 60e9e39..fdc71ef 100644 --- a/check.log +++ b/check.log @@ -1,18 +1,19 @@ * using log directory ‘/home/jranke/git/chemCal/chemCal.Rcheck’ -* using R version 4.1.3 (2022-03-10) -* using platform: x86_64-pc-linux-gnu (64-bit) +* using R version 4.4.2 (2024-10-31) +* using platform: x86_64-pc-linux-gnu +* R was compiled by + gcc (Debian 12.2.0-14) 12.2.0 + GNU Fortran (Debian 12.2.0-14) 12.2.0 +* running under: Debian GNU/Linux 12 (bookworm) * using session charset: UTF-8 * using option ‘--as-cran’ * checking for file ‘chemCal/DESCRIPTION’ ... OK -* this is package ‘chemCal’ version ‘0.2.3’ +* this is package ‘chemCal’ version ‘0.2.3.9000’ * package encoding: UTF-8 -* checking CRAN incoming feasibility ... NOTE +* checking CRAN incoming feasibility ... [3s/15s] NOTE Maintainer: ‘Johannes Ranke ’ -New maintainer: - Johannes Ranke -Old maintainer(s): - Johannes Ranke +Version contains large components (0.2.3.9000) * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK @@ -21,18 +22,18 @@ Old maintainer(s): * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK -* checking serialization versions ... OK * checking whether package ‘chemCal’ can be installed ... OK * checking installed package size ... OK * checking package directory ... OK -* checking for future file timestamps ... OK +* checking for future file timestamps ... NOTE +unable to verify current time * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK -* checking R files for non-ASCII characters ... OK +* checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK @@ -67,16 +68,16 @@ Old maintainer(s): Running ‘testthat.R’ OK * checking for unstated dependencies in vignettes ... OK -* checking package vignettes in ‘inst/doc’ ... OK +* checking package vignettes ... OK * checking re-building of vignette outputs ... OK * checking PDF version of manual ... OK +* checking HTML version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE -Status: 1 NOTE +Status: 2 NOTEs See ‘/home/jranke/git/chemCal/chemCal.Rcheck/00check.log’ for details. - diff --git a/data/din38402b1.rda b/data/din38402b1.rda index 9436f8a..ccaf554 100644 Binary files a/data/din38402b1.rda and b/data/din38402b1.rda differ diff --git a/data/din38402b3.rda b/data/din38402b3.rda index 699c76b..80e80e3 100644 Binary files a/data/din38402b3.rda and b/data/din38402b3.rda differ diff --git a/data/din38402b6.rda b/data/din38402b6.rda index 3b81120..def8f0e 100644 Binary files a/data/din38402b6.rda and b/data/din38402b6.rda differ diff --git a/data/din38402c3.rda b/data/din38402c3.rda index 7e83cf6..c4688ef 100644 Binary files a/data/din38402c3.rda and b/data/din38402c3.rda differ diff --git a/man/din32645.Rd b/man/din32645.Rd index a8e6a31..5b9603f 100644 --- a/man/din32645.Rd +++ b/man/din32645.Rd @@ -7,6 +7,9 @@ \format{ A dataframe containing 10 rows of x and y values. } +\usage{ +din32645 +} \description{ Sample dataset to test the package. } diff --git a/man/din38402b1.Rd b/man/din38402b1.Rd index 10ccddc..2c538b8 100644 --- a/man/din38402b1.Rd +++ b/man/din38402b1.Rd @@ -8,6 +8,9 @@ A tibble containing 12 concentration levels with the respective instrument response values. } +\usage{ +din38402b1 +} \description{ Example dataset B.1 from DIN 38402 with concentrations in µg/L and the extinction as response measured using continuous flow analysis (CFA) according to diff --git a/man/din38402b3.Rd b/man/din38402b3.Rd index b4b5504..83abd0f 100644 --- a/man/din38402b3.Rd +++ b/man/din38402b3.Rd @@ -8,6 +8,9 @@ A tibble containing 13 concentration levels and the respective instrument response values. } +\usage{ +din38402b3 +} \description{ Example dataset B.3 from DIN 38402. Cu was measured according to ISO 11885, using ICP-OES. The concentration are reported in mg/L and the response as diff --git a/man/din38402b6.Rd b/man/din38402b6.Rd index feb3577..289ee41 100644 --- a/man/din38402b6.Rd +++ b/man/din38402b6.Rd @@ -8,6 +8,9 @@ A tibble containing 12 concentration levels and the respective instrument response values. } +\usage{ +din38402b6 +} \description{ Example dataset B.6 from DIN 38402 measured using LC-MS/MS. The concentrations are reported in in µg/L and the response in arbitrary diff --git a/man/din38402c3.Rd b/man/din38402c3.Rd index 7c00999..e9ac83e 100644 --- a/man/din38402c3.Rd +++ b/man/din38402c3.Rd @@ -8,6 +8,9 @@ A tibble containing 10 concentration levels and the respective response values. } +\usage{ +din38402c3 +} \description{ Example dataset C.3 from DIN 38402 determined by ion chromatography. Concentrations are reported in mg/L and the extinction as response. diff --git a/man/linearity.Rd b/man/linearity.Rd index aa3d857..52c2423 100644 --- a/man/linearity.Rd +++ b/man/linearity.Rd @@ -41,12 +41,14 @@ identification of non-linear behaviour of calibration curves (Andrade and Gomes-Carracedo, 2013). } \examples{ -data(din32645) +# Continuous Flow Analysis (CFA) data +data(din38402b1) + # Point-to-point slope plot -linearity(din32645$x, din32645$y, method = "slope") +linearity(din38402b1$conc, din38402b1$ext, method = "slope") # Curvature plot -linearity(din32645$x, din32645$y, method = "curvature", tolerance = 0.2) +linearity(din38402b1$conc, din38402b1$ext, method = "curvature") } \references{ @@ -58,5 +60,5 @@ Mandel's test to check for nonlinearity in laboratory calibrations. Analytical Methods 5(5), 1145 - 1149. } \author{ -Anil Axel Tellbüscher +Anıl Axel Tellbüscher } diff --git a/man/massart97ex1.Rd b/man/massart97ex1.Rd index d154a9c..c49f416 100644 --- a/man/massart97ex1.Rd +++ b/man/massart97ex1.Rd @@ -12,6 +12,9 @@ Massart, L.M, Vandenginste, B.G.M., Buydens, L.M.C., De Jong, S., Lewi, P.J., Smeyers-Verbeke, J. (1997) Handbook of Chemometrics and Qualimetrics: Part A, Chapter 8. } +\usage{ +massart97ex1 +} \description{ Sample dataset from p. 175 to test the package. } diff --git a/man/massart97ex3.Rd b/man/massart97ex3.Rd index 284a435..82d3191 100644 --- a/man/massart97ex3.Rd +++ b/man/massart97ex3.Rd @@ -13,6 +13,9 @@ Massart, L.M, Vandenginste, B.G.M., Buydens, L.M.C., De Jong, S., Lewi, P.J., Smeyers-Verbeke, J. (1997) Handbook of Chemometrics and Qualimetrics: Part A, Chapter 8. } +\usage{ +massart97ex3 +} \description{ Sample dataset from p. 188 to test the package. } diff --git a/man/rl95_cadmium.Rd b/man/rl95_cadmium.Rd index 8e0b02c..db6a841 100644 --- a/man/rl95_cadmium.Rd +++ b/man/rl95_cadmium.Rd @@ -13,6 +13,9 @@ six calibration standards. Rocke, David M. und Lorenzato, Stefan (1995) A two-component model for measurement error in analytical chemistry. Technometrics 37(2), 176-184. } +\usage{ +rl95_cadmium +} \description{ Dataset reproduced from Table 1 in Rocke and Lorenzato (1995). } diff --git a/man/rl95_toluene.Rd b/man/rl95_toluene.Rd index 1f8836a..2e0f3a5 100644 --- a/man/rl95_toluene.Rd +++ b/man/rl95_toluene.Rd @@ -12,6 +12,9 @@ six calibration standards. Rocke, David M. und Lorenzato, Stefan (1995) A two-component model for measurement error in analytical chemistry. Technometrics 37(2), 176-184. } +\usage{ +rl95_toluene +} \description{ Dataset reproduced from Table 4 in Rocke and Lorenzato (1995). The toluene amount in the calibration samples is given in picograms per 100 µL. diff --git a/man/utstats14.Rd b/man/utstats14.Rd index 1b739d4..bb952ff 100644 --- a/man/utstats14.Rd +++ b/man/utstats14.Rd @@ -14,6 +14,9 @@ Tutorial website maintained by the Departments of Chemistry, University of Toronto. \url{https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/index.html} } +\usage{ +utstats14 +} \description{ Dataset read into R from \url{https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/files/example14.xls}. -- cgit v1.2.1 From 4384c9c3680f6a5cfdb59b325b1f6039b555848c Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 22 Jan 2025 17:28:54 +0100 Subject: Add Anil A. Tellbuescher as author, NEWS --- DESCRIPTION | 9 ++++++--- NEWS.md | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index de910c5..d870c97 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,9 +2,12 @@ Package: chemCal Version: 0.2.3.9000 Date: 2025-01-25 Title: Calibration Functions for Analytical Chemistry -Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), - email = "johannes.ranke@jrwb.de", - comment = c(ORCID = "0000-0003-4371-6538"))) +Authors@R: c( + person(c("Anil", "A."), "Tellbuescher", role = "aut", + comment = "Linearity tests"), + person("Johannes", "Ranke", role = c("aut", "cre", "cph"), + email = "johannes.ranke@jrwb.de", + comment = c(ORCID = "0000-0003-4371-6538"))) Depends: R (>= 3.5.0) Suggests: MASS, knitr, testthat, investr, covr, rmarkdown Description: Simple functions for plotting linear diff --git a/NEWS.md b/NEWS.md index 5e86e24..a680498 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# chemCal 0.2.3.9000 + +- 'R/linearity.R', 'data/din38402*.rda': Add linearity tests and data from DIN 38402 using a pull request by Anil Axel Tellbüscher + # chemCal 0.2.3 - Make the use of the 'investr' package conditional in testthat tests, update maintainer e-mail address -- cgit v1.2.1 From 34b6b8408f1ab8593ba1e9ed89a98830a4b92099 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 22 Jan 2025 17:53:26 +0100 Subject: Use author name in DESCRIPTION as spelled by himself --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d870c97..d8a9779 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,7 +3,7 @@ Version: 0.2.3.9000 Date: 2025-01-25 Title: Calibration Functions for Analytical Chemistry Authors@R: c( - person(c("Anil", "A."), "Tellbuescher", role = "aut", + person(c("Anıl", "A."), "Tellbüscher", role = "aut", comment = "Linearity tests"), person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "johannes.ranke@jrwb.de", -- cgit v1.2.1