diff --git a/NAMESPACE b/NAMESPACE index 470d47faf5..dbc87c9be6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -137,6 +137,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/NEWS.md b/NEWS.md index 0a4f7ce125..4f41977fe3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ ## New Features +- Created function `hello_admiral()` as part of onboarding task. (#1839) + ## Updates of Existing Functions ## Breaking Changes diff --git a/R/my_first_fcn.R b/R/my_first_fcn.R new file mode 100644 index 0000000000..42abab19bf --- /dev/null +++ b/R/my_first_fcn.R @@ -0,0 +1,21 @@ +#' Derive Extension Example +#' +#' Says hello admiral +#' +#' @param hw TRUE or FALSE +#' +#' @author Anders +#' +#' @return Happy Message +#' +#' @export +#' +#' @examples +#' hello_admiral(hw = FALSE) +hello_admiral <- function(hw = TRUE) { + if (hw) { + message("Welcome to the admiral family hw!") + } else { + message("Welcome to the admiral family!") + } +} diff --git a/inst/WORDLIST b/inst/WORDLIST index 80377d3675..9c451564c7 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -36,8 +36,8 @@ Akinyi Alanine Alkalosis Analyte +Anders Ania -Asha Aspartate BDS BILI @@ -61,7 +61,6 @@ CTCAEV CTCAEv CVD Carlucci -Chakma Cheatsheet Chemistries Chol @@ -96,7 +95,6 @@ Fibrinogen Findability Framingham Franciszek -Francois Fridericia Fridericia's Fujimoto @@ -304,6 +302,7 @@ modularized msec nd occds +onboarding onwards parttime pharmaverse diff --git a/man/hello_admiral.Rd b/man/hello_admiral.Rd new file mode 100644 index 0000000000..25552e483c --- /dev/null +++ b/man/hello_admiral.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/my_first_fcn.R +\name{hello_admiral} +\alias{hello_admiral} +\title{Derive Extension Example} +\usage{ +hello_admiral(hw = TRUE) +} +\arguments{ +\item{hw}{TRUE or FALSE} +} +\value{ +Happy Message +} +\description{ +Says hello admiral +} +\examples{ +hello_admiral(hw = FALSE) +} +\author{ +Anders +} diff --git a/tests/testthat/test-my_first_fcn.R b/tests/testthat/test-my_first_fcn.R new file mode 100644 index 0000000000..39e7ea3f63 --- /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 hw!\\n" + ) +}) + +test_that("hello admiral greets with hm", { + expect_message( + hello_admiral(hw = TRUE), + "^Welcome to the admiral family hw!\\n" + ) +}) + +test_that("hello admiral greets with hw", { + expect_message( + hello_admiral(hw = FALSE), + "^Welcome to the admiral family!\\n" + ) +})