Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #1839 dummy function created #2485

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

## New Features

- New function `derive_vars_crit_flag()` for deriving criterion flag variables
(`CRITy`, `CRITyFL`, `CRITyFLN`). (#2468)
- New function 'my_first_fcn()' as dummy practice (#1839)

## Updates of Existing Functions

Expand Down
25 changes: 25 additions & 0 deletions R/my_first_fcn.R
Original file line number Diff line number Diff line change
@@ -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_adxx
#'
#' @keywords der_adxx
#'
#' @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!")
}
}
2 changes: 2 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ADVS
ADaM
ADaMIG
ADaMs
adxx
AE
AEDECOD
AELLTCD
Expand Down Expand Up @@ -89,6 +90,7 @@ EPI
Ehmann
FACM
FCVD
fcn
Fibrinogen
Findability
Framingham
Expand Down
26 changes: 26 additions & 0 deletions man/my_first_fcn.R.Rd

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

20 changes: 20 additions & 0 deletions tests/testthat/test-my_first_fcn.R
Original file line number Diff line number Diff line change
@@ -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"
)
})
Loading