Skip to content

Commit

Permalink
Documentation of function pull added
Browse files Browse the repository at this point in the history
  • Loading branch information
fpahlke committed Apr 5, 2024
1 parent e2294a7 commit 9f3df45
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 29 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rpact
Title: Confirmatory Adaptive Clinical Trial Design and Analysis
Version: 4.0.0.9238
Date: 2024-03-28
Version: 4.0.0.9239
Date: 2024-04-05
Authors@R: c(
person(
given = "Gernot",
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ S3method(as.data.frame,TrialDesignSet)
S3method(as.list,Dictionary)
S3method(as.matrix,FieldSet)
S3method(as.vector,Dictionary)
S3method(kable,ParameterSet)
S3method(knit_print,ParameterSet)
S3method(knit_print,SummaryFactory)
S3method(length,TrialDesignSet)
Expand Down Expand Up @@ -114,7 +115,6 @@ export(getStageResults)
export(getTestActions)
export(getWideFormat)
export(kable)
export(kable.ParameterSet)
export(mvnprd)
export(mvstud)
export(plotTypes)
Expand Down
2 changes: 1 addition & 1 deletion R/class_analysis_dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ writeDatasets <- function(datasets, file, ..., append = FALSE, quote = TRUE, sep
if (length(args) == 2 && !is.null(design)) {
dataset <- .getDatasetFromArgs(...)
if (!is.null(dataset)) {
dataset <- dataset$clone(deep = TRUE) # TODO was $copy shallow
dataset <- dataset$clone(deep = TRUE)
dataset$.design <- design
return(dataset)
}
Expand Down
34 changes: 15 additions & 19 deletions R/class_core_parameter_set.R
Original file line number Diff line number Diff line change
Expand Up @@ -1642,15 +1642,22 @@ print.ParameterSet <- function(x, ..., markdown = NA) {
return(invisible(x))
}

#'
#' @rdname pull.ParameterSet
#'
#' @export
#'
pull <- function(x, var) UseMethod("pull")

#'
#' @title
#' Extract a single parameter
#'
#' @description
#' Pull a parameter from a parameter set.
#'
#' @param var A variable specified as:
#' @param x The \code{\link{ParameterSet}} object to pull from.
#' @param var A variable specified as:
#' - a literal variable name
#' - a positive integer, giving the position counting from the left
#' - a negative integer, giving the position counting from the right.
Expand Down Expand Up @@ -1680,7 +1687,6 @@ pull.ParameterSet <- function(x, var = -1) {
if (var == 0) {
stop(C_EXCEPTION_TYPE_ILLEGAL_ARGUMENT, "'x' (", x, ") must != 0")
}
x <- addTrace(x, "pull", var)
if (var < 0) {
var <- length(x) + 1 - var
}
Expand Down Expand Up @@ -1751,6 +1757,13 @@ knit_print.ParameterSet <- function(x, ...) {
return(knitr::asis_output(result))
}

#'
#' @rdname kable.ParameterSet
#'
#' @export
#'
kable <- function(x, ...) UseMethod("kable")

#'
#' @title
#' Create output in Markdown
Expand Down Expand Up @@ -1795,20 +1808,3 @@ kable.ParameterSet <- function(x, ...) {
.assertPackageIsInstalled("knitr")
knitr::kable(x, ...)
}

#'
#' @title
#' Create tables in Markdown
#'
#' @description
#' The \code{kable()} function returns a single table for a single object that inherits from class \code{\link{ParameterSet}}.
#'
#' @details
#' Generic to represent a parameter set in Markdown.
#'
#' @param x The object that inherits from \code{\link{ParameterSet}}.
#' @param ... Other arguments (see \code{\link[knitr]{kable}}).
#'
#' @export
#'
setGeneric("kable", kable.ParameterSet)
2 changes: 1 addition & 1 deletion R/f_analysis_base.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ NULL

return(list(
design = design,
dataInput = dataInput$clone(deep = TRUE) # TODO was $copy shallow
dataInput = dataInput$clone(deep = TRUE)
))
}

Expand Down
4 changes: 2 additions & 2 deletions inst/doc/rpact_getting_started.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<meta name="author" content="Friedrich Pahlke and Gernot Wassmer" />

<meta name="date" content="2024-03-28" />
<meta name="date" content="2024-04-05" />

<title>Getting started with rpact</title>

Expand Down Expand Up @@ -239,7 +239,7 @@

<h1 class="title toc-ignore">Getting started with rpact</h1>
<h4 class="author">Friedrich Pahlke and Gernot Wassmer</h4>
<h4 class="date">2024-03-28</h4>
<h4 class="date">2024-04-05</h4>



Expand Down
7 changes: 5 additions & 2 deletions man/kable.ParameterSet.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion man/pull.ParameterSet.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9f3df45

Please sign in to comment.