diff --git a/DESCRIPTION b/DESCRIPTION index 8179ca0bb5..8cedc3e037 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,7 +27,8 @@ Authors@R: c( person("Kangjie", "Zhang", role = "aut"), person("Zelos", "Zhu", role = "aut"), person("F. Hoffmann-La Roche AG", role = c("cph", "fnd")), - person("GlaxoSmithKline LLC", role = c("cph", "fnd")) + person("GlaxoSmithKline LLC", role = c("cph", "fnd")), + person("Shunsuke", "Goto", role = "aut") ) Description: A toolbox for programming Clinical Data Interchange Standards Consortium (CDISC) compliant Analysis Data Model (ADaM) datasets in R. diff --git a/NAMESPACE b/NAMESPACE index 9bab92b1cf..47114d4e37 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -146,6 +146,7 @@ export(list_all_templates) export(list_tte_source_objects) export(max_cond) export(min_cond) +export(my_first_fcn) export(negate_vars) export(params) export(print_named_list) diff --git a/NEWS.md b/NEWS.md index 91fb0405c8..7948f14d60 100644 --- a/NEWS.md +++ b/NEWS.md @@ -62,6 +62,8 @@ again. (#2462) - New `country_code_lookup()` metadata added to decode countries based on [ISO 3166 codes](https://www.iso.org/iso-3166-country-codes.html). (#2388) +- Added function `my_first_fcn()` (#1839). + ## Updates of Existing Functions - `group_var` (optional) parameter is added to `derive_var_trtemfl()` to derive `TRTEMFL` for AE data if the data are collected as one episode of AE with multiple lines. (#2302) diff --git a/R/my_first_fcn.R b/R/my_first_fcn.R new file mode 100644 index 0000000000..f40d7a54da --- /dev/null +++ b/R/my_first_fcn.R @@ -0,0 +1,21 @@ +#' my_first_fcn +#' +#' my first function +#' +#' @details +#' This is a function created as dummy. +#' +#' @keywords other_advanced +#' +#' @family other_advanced +#' +#' @return +#' This function returns the Character "Welcome to the admiral family!". +#' +#' @export +#' +#' @examples +#' my_first_fcn() ## returns "Welcome to the admiral family!" +my_first_fcn <- function() { + "Welcome to the admiral family!" +} diff --git a/inst/WORDLIST b/inst/WORDLIST index e3a009b79f..a44188656c 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -284,6 +284,7 @@ eg egfr evaluable exprs +fcn fil findable fmt diff --git a/man/admiral-package.Rd b/man/admiral-package.Rd index a1539a481d..aeaceee83f 100644 --- a/man/admiral-package.Rd +++ b/man/admiral-package.Rd @@ -47,6 +47,7 @@ Authors: \item Phillip Webster \item Kangjie Zhang \item Zelos Zhu + \item Shunsuke Goto } Other contributors: diff --git a/man/list_tte_source_objects.Rd b/man/list_tte_source_objects.Rd index db624766b1..a6e310c726 100644 --- a/man/list_tte_source_objects.Rd +++ b/man/list_tte_source_objects.Rd @@ -21,6 +21,7 @@ list_tte_source_objects() } \seealso{ Other Advanced Functions: +\code{\link{my_first_fcn}()}, \code{\link{params}()} } \concept{other_advanced} diff --git a/man/my_first_fcn.Rd b/man/my_first_fcn.Rd new file mode 100644 index 0000000000..1d49812200 --- /dev/null +++ b/man/my_first_fcn.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/my_first_fcn.R +\name{my_first_fcn} +\alias{my_first_fcn} +\title{my_first_fcn} +\usage{ +my_first_fcn() +} +\value{ +This function returns the Character "Welcome to the admiral family!". +} +\description{ +my first function +} +\details{ +This is a function created as dummy. +} +\examples{ +my_first_fcn() ## returns "Welcome to the admiral family!" +} +\seealso{ +Other Advanced Functions: +\code{\link{list_tte_source_objects}()}, +\code{\link{params}()} +} +\concept{other_advanced} +\keyword{other_advanced} diff --git a/man/params.Rd b/man/params.Rd index ba41405a43..3e1c8b4176 100644 --- a/man/params.Rd +++ b/man/params.Rd @@ -100,7 +100,8 @@ call_derivation( \code{\link[=call_derivation]{call_derivation()}} Other Advanced Functions: -\code{\link{list_tte_source_objects}()} +\code{\link{list_tte_source_objects}()}, +\code{\link{my_first_fcn}()} } \concept{other_advanced} \keyword{other_advanced} diff --git a/tests/testthat/test-my_first_fcn.R b/tests/testthat/test-my_first_fcn.R new file mode 100644 index 0000000000..1d49323830 --- /dev/null +++ b/tests/testthat/test-my_first_fcn.R @@ -0,0 +1,9 @@ +# my_first_fcn ---- +## Test 1: ---- +test_that("multiplication works", { + expected_output <- "Welcome to the admiral family!" + + actual_output <- my_first_fcn() + + expect_equal(expected_output, actual_output) +})