Documentation runs @examples code correctly.
Build and deploy Roxygen2|pkgdown documentation site / build-and-deploy-documentation (push) Successful in 42s
run tests / build-and-deploy-documentation (push) Successful in 7s

IMPORTANT: examples must be written in a self-contained way
They always run from a clean workspace with no global variables.
This commit is contained in:
Simon Innerbichler
2026-06-03 11:48:40 +02:00
parent 4cfdc288a8
commit b2eb61a820
+16 -7
View File
@@ -35,6 +35,7 @@ library(scales)
#' potency estimates and respective CIs of restricted and unrestricted models, and the predictions thereof. #' potency estimates and respective CIs of restricted and unrestricted models, and the predictions thereof.
#' @export #' @export
#' @examples #' @examples
#' suppressMessages(source("../../dev/setup.R"))
#' dat <- data.frame( #' dat <- data.frame(
#' REF1 = c(1547, 1620, 1644, 2504, 3426, 3512, 3401, 3787), REF2 = c(1492, 1536, 1384, 2286, 3046, 3479, 3516, 3497), #' REF1 = c(1547, 1620, 1644, 2504, 3426, 3512, 3401, 3787), REF2 = c(1492, 1536, 1384, 2286, 3046, 3479, 3516, 3497),
#' REF3 = c(1468, 1827, 1558, 2252, 3002, 3349, 2945, 3665), #' REF3 = c(1468, 1827, 1558, 2252, 3002, 3349, 2945, 3665),
@@ -175,6 +176,7 @@ Fitting_FUNC <- function(ro_new, TransFlag = FALSE) {
#' @returns A grid object with 2 linearity plots, restricted and unrestricted model. #' @returns A grid object with 2 linearity plots, restricted and unrestricted model.
#' @export #' @export
#' @examples #' @examples
#' suppressMessages(source("../../dev/setup.R"))
#' data.frame( #' data.frame(
#' R_dil1 = c( #' R_dil1 = c(
#' 10.0651024695491, 10.9844983291817, 10.7635586089293, 10.4597656321327, 10.3898668457823, 10.8171761349909, #' 10.0651024695491, 10.9844983291817, 10.7635586089293, 10.4597656321327, 10.3898668457823, 10.8171761349909,
@@ -256,6 +258,7 @@ plotSingularity <- function(dat) { # sigmoid,det_sig,
#' @returns A grid object either of the original scale or the natural log of the readouts. #' @returns A grid object either of the original scale or the natural log of the readouts.
#' @export #' @export
#' @examples #' @examples
#' suppressMessages(source("../../dev/setup.R"))
#' dat <- data.frame( #' dat <- data.frame(
#' REF1 = c(1547, 1620, 1644, 2504, 3426, 3512, 3401, 3787), REF2 = c(1492, 1536, 1384, 2286, 3046, 3479, 3516, 3497), #' REF1 = c(1547, 1620, 1644, 2504, 3426, 3512, 3401, 3787), REF2 = c(1492, 1536, 1384, 2286, 3046, 3479, 3516, 3497),
#' REF3 = c(1468, 1827, 1558, 2252, 3002, 3349, 2945, 3665), #' REF3 = c(1468, 1827, 1558, 2252, 3002, 3349, 2945, 3665),
@@ -490,6 +493,7 @@ plot_f <- function(dat, TransFlag = FALSE) { # sigmoid,det_sig,
#' @returns A data-frame with readouts and natural log of concentrations. #' @returns A data-frame with readouts and natural log of concentrations.
#' @export #' @export
#' @examples #' @examples
#' suppressMessages(source("../../dev/setup.R"))
#' as <- 3 #' as <- 3
#' bs <- 1 #' bs <- 1
#' cs <- -4 #' cs <- -4
@@ -546,6 +550,7 @@ Calc_DilRes <- function(as = 3, bs = 1, cs = -4, ds = 10, at = 3, bt = 1, dt = 1
#' @returns A data-frame with potency estimate, absolute CIs, test result, relative CIs. #' @returns A data-frame with potency estimate, absolute CIs, test result, relative CIs.
#' @export #' @export
#' @examples #' @examples
#' suppressMessages(source("../../dev/setup.R"))
#' CIRC <- data.frame( #' CIRC <- data.frame(
#' log_dose = c( #' log_dose = c(
#' -2.5, -2.5, -2.5, -3.2, -3.2, -3.2, -3.9, -3.9, -3.9, #' -2.5, -2.5, -2.5, -3.2, -3.2, -3.2, -3.9, -3.9, -3.9,
@@ -632,6 +637,7 @@ LinPotTab <- function(circles, Lim, PureErrFlag) {
#' 4) summary of restricted linear model. #' 4) summary of restricted linear model.
#' @export #' @export
#' @examples #' @examples
#' suppressMessages(source("../../dev/setup.R"))
#' dat <- data.frame( #' dat <- data.frame(
#' R_dil1 = c(10221, 18258, 31993, 49336, 68332, 83527, 95584, 102229), #' R_dil1 = c(10221, 18258, 31993, 49336, 68332, 83527, 95584, 102229),
#' R_dil2 = c(10136, 19078, 31925, 49003, 68034, 83776, 95495, 101608), #' R_dil2 = c(10136, 19078, 31925, 49003, 68034, 83776, 95495, 101608),
@@ -854,9 +860,9 @@ ANOVAlintests <- function(ro_new, circles, Lim, PureErrFlag) {
#' @param indT Index of dilution, where regression starts for test sample. #' @param indT Index of dilution, where regression starts for test sample.
#' @returns A grid object of 2 plots of unrestricted and restricted linear PLA models. #' @returns A grid object of 2 plots of unrestricted and restricted linear PLA models.
#' @export #' @export
#' @examples #' @examplesIf interactive()
#' circle <- read.csv("~/plateflow/circle.csv") #' circle <- read.csv("tests/circle.csv")
#' all_l2 <- read.csv("~/plateflow/all_l2.csv") #' all_l2 <- read.csv("tests/all_l2.csv")
#' sigmoid <- c(10.0, 10.0, 110.0, 110.0, 1.0, 1.0, -3.5, 0.0) #' sigmoid <- c(10.0, 10.0, 110.0, 110.0, 1.0, 1.0, -3.5, 0.0)
#' indS <- 3 #' indS <- 3
#' indT <- 3 #' indT <- 3
@@ -866,7 +872,6 @@ ANOVAlintests <- function(ro_new, circles, Lim, PureErrFlag) {
#' plotT = c(114.213375, 97.588663, 80.963951, 64.339239, 47.714527, 31.102604, 14.477892, -2.095735) #' plotT = c(114.213375, 97.588663, 80.963951, 64.339239, 47.714527, 31.102604, 14.477892, -2.095735)
#' ) #' )
#' #'
#'
#' PlotLinPLA_FUNC(circle, sigmoid, all_l2, pl_df, indS, indT) #' PlotLinPLA_FUNC(circle, sigmoid, all_l2, pl_df, indS, indT)
PlotLinPLA_FUNC <- function(circle, sigmoid, all_l2, pl_df, indS, indT) { PlotLinPLA_FUNC <- function(circle, sigmoid, all_l2, pl_df, indS, indT) {
# browser() # browser()
@@ -988,6 +993,7 @@ PlotLinPLA_FUNC <- function(circle, sigmoid, all_l2, pl_df, indS, indT) {
#' 4) summary of restricted linear model. #' 4) summary of restricted linear model.
#' @export #' @export
#' @examples #' @examples
#' suppressMessages(source("../../dev/setup.R"))
#' ro_new <- data.frame( #' ro_new <- data.frame(
#' R_dil1 = c(10221, 18258, 31993, 49336, 68332, 83527, 95584, 102229), #' R_dil1 = c(10221, 18258, 31993, 49336, 68332, 83527, 95584, 102229),
#' R_dil2 = c(10136, 19078, 31925, 49003, 68034, 83776, 95495, 101608), #' R_dil2 = c(10136, 19078, 31925, 49003, 68034, 83776, 95495, 101608),
@@ -1088,6 +1094,7 @@ pot4plFUNC <- function(ro_new, PureErrFlag) {
#' @returns A data-frame with the lower and upper CI in anti-log form. #' @returns A data-frame with the lower and upper CI in anti-log form.
#' @export #' @export
#' @examples #' @examples
#' suppressMessages(source("../../dev/setup.R"))
#' xs <- 2 #' xs <- 2
#' xt <- 3.2 #' xt <- 3.2
#' se_xt <- 0.34 #' se_xt <- 0.34
@@ -1121,6 +1128,7 @@ ParamCI_F <- function(xt, xs, se_xt, se_xs, CoVar, DFs, Conf = 0.975) {
#' @returns A data-frame with the lower and upper CI in anti-log form. #' @returns A data-frame with the lower and upper CI in anti-log form.
#' @export #' @export
#' @examples #' @examples
#' suppressMessages(source("../../dev/setup.R"))
#' #'
#' dat <- data.frame( #' dat <- data.frame(
#' REF1 = c(1547, 1620, 1644, 2504, 3426, 3512, 3401, 3787), REF2 = c(1492, 1536, 1384, 2286, 3046, 3479, 3516, 3497), #' REF1 = c(1547, 1620, 1644, 2504, 3426, 3512, 3401, 3787), REF2 = c(1492, 1536, 1384, 2286, 3046, 3479, 3516, 3497),
@@ -1353,7 +1361,7 @@ tests_FUNC <- function(ro_new, Lim, PureErrFlag) {
#' @returns A data-frame with the analysis of variance. #' @returns A data-frame with the analysis of variance.
#' @export #' @export
#' @examples #' @examples
#' #' suppressMessages(source("../../dev/setup.R"))
#' ro_new <- data.frame( #' ro_new <- data.frame(
#' REF1 = c(1547, 1620, 1644, 2504, 3426, 3512, 3401, 3787), REF2 = c(1492, 1536, 1384, 2286, 3046, 3479, 3516, 3497), #' REF1 = c(1547, 1620, 1644, 2504, 3426, 3512, 3401, 3787), REF2 = c(1492, 1536, 1384, 2286, 3046, 3479, 3516, 3497),
#' REF3 = c(1468, 1827, 1558, 2252, 3002, 3349, 2945, 3665), #' REF3 = c(1468, 1827, 1558, 2252, 3002, 3349, 2945, 3665),
@@ -1445,7 +1453,8 @@ ANOVA4plUnresfunc <- function(ro_new) {
#' @returns A data-frame with the concentrations and metadata. #' @returns A data-frame with the concentrations and metadata.
#' @export #' @export
#' @examples #' @examples
#' #' suppressMessages(source("../../dev/setup.R"))
#'
#' ro_new <- data.frame( #' ro_new <- data.frame(
#' REF1 = c(1547, 1620, 1644, 2504, 3426, 3512, 3401, 3787), REF2 = c(1492, 1536, 1384, 2286, 3046, 3479, 3516, 3497), #' REF1 = c(1547, 1620, 1644, 2504, 3426, 3512, 3401, 3787), REF2 = c(1492, 1536, 1384, 2286, 3046, 3479, 3516, 3497),
#' REF3 = c(1468, 1827, 1558, 2252, 3002, 3349, 2945, 3665), #' REF3 = c(1468, 1827, 1558, 2252, 3002, 3349, 2945, 3665),
@@ -1453,7 +1462,6 @@ ANOVA4plUnresfunc <- function(ro_new) {
#' TEST3 = c(1399, 1376, 1588, 1475, 2148, 3083, 2942, 3466), log_dose = c(5.01, 3.401, 2.708, 2.015, 1.32176, 0.62861, -0.0645385, -1.6739764) #' TEST3 = c(1399, 1376, 1588, 1475, 2148, 3083, 2942, 3466), log_dose = c(5.01, 3.401, 2.708, 2.015, 1.32176, 0.62861, -0.0645385, -1.6739764)
#' ) #' )
#' #'
#'
#' perConcTab(ro_new, noDilSeries = 3) #' perConcTab(ro_new, noDilSeries = 3)
perConcTab <- function(ro_new, noDilSeries) { perConcTab <- function(ro_new, noDilSeries) {
Reftab <- ro_new[, c(1:noDilSeries)] Reftab <- ro_new[, c(1:noDilSeries)]
@@ -1489,6 +1497,7 @@ perConcTab <- function(ro_new, noDilSeries) {
#' @returns A data-frame with the concentrations and metadata. #' @returns A data-frame with the concentrations and metadata.
#' @export #' @export
#' @examples #' @examples
#' suppressMessages(source("../../dev/setup.R"))
#' #'
#' x <- 1 #' x <- 1
#' Div <- 3 #' Div <- 3