diff --git a/NAMESPACE b/NAMESPACE index 8e9b124535..aaf646d9d4 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -138,6 +138,7 @@ export(get_not_mapped) export(get_one_to_many_dataset) export(get_summary_records) export(get_vars_query) +export(hello_admiral) export(impute_dtc_dt) export(impute_dtc_dtm) export(lastalive_censor) diff --git a/R/.gitignore b/R/.gitignore new file mode 100644 index 0000000000..16ab716540 --- /dev/null +++ b/R/.gitignore @@ -0,0 +1 @@ +my_first_fcn.R diff --git a/R/my_first_fcn.R b/R/my_first_fcn.R new file mode 100644 index 0000000000..7abdd920f9 --- /dev/null +++ b/R/my_first_fcn.R @@ -0,0 +1,25 @@ +#' @name my_first_fcn.R +#' +#' @title Hello Admiral Function +#' +#' @param hw TRUE or FALSE +#' +#' @details First function to generate welcome message +#' +#' @return Happy Message +#' +#' @family der_adsl +#' +#' @keywords der_adsl +#' +#' @export +#' +#' @examples +#' hello_admiral(hw = FALSE) +hello_admiral <- function(hw = TRUE) { + if (hw) { + message("Welcome to the admiral family!") + } else { + message("Welcome to the admiral family!") + } +} diff --git a/inst/WORDLIST b/inst/WORDLIST index ad1b8d709e..bd5244b696 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -193,6 +193,7 @@ README Rahal Ratford Romain +Rothstein SCE SCN SCOPEN @@ -249,6 +250,7 @@ admiralophtha admiralvaccine admiralxxx adsl +adxx alanine aminotransferase analyte diff --git a/man/my_first_fcn.R.Rd b/man/my_first_fcn.R.Rd new file mode 100644 index 0000000000..537b1fe720 --- /dev/null +++ b/man/my_first_fcn.R.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/my_first_fcn.R +\name{my_first_fcn.R} +\alias{my_first_fcn.R} +\alias{hello_admiral} +\title{Hello Admiral Function} +\usage{ +hello_admiral(hw = TRUE) +} +\arguments{ +\item{hw}{TRUE or FALSE} +} +\value{ +Happy Message +} +\description{ +Hello Admiral Function +} +\details{ +First function to generate welcome message +} +\examples{ +hello_admiral(hw = FALSE) +} +\seealso{ +ADSL Functions that returns variable appended to dataset: +\code{\link{derive_var_age_years}()}, +\code{\link{derive_vars_aage}()}, +\code{\link{derive_vars_extreme_event}()}, +\code{\link{derive_vars_period}()} +} +\concept{der_adsl} +\keyword{der_adsl} diff --git a/tests/testthat/test-my_first_fcn.R b/tests/testthat/test-my_first_fcn.R new file mode 100644 index 0000000000..72e4aac15a --- /dev/null +++ b/tests/testthat/test-my_first_fcn.R @@ -0,0 +1,20 @@ +test_that("hello admiral greets without hw", { + expect_message( + hello_admiral(), + "^Welcome to the admiral family!\\n" + ) +}) + +test_that("hello admiral greets with hw", { + expect_message( + hello_admiral(hw = TRUE), + "^Welcome to the admiral family!\\n" + ) +}) + +test_that("hello admiral greets with hw", { + expect_message( + hello_admiral(hw = FALSE), + "^Welcome to the admiral family!\\n" + ) +})