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 #2593 feat: Add my_first_fcn to welcome new users #2593

Closed
wants to merge 7 commits into from
Closed
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ or that the queries dataset contains duplicates. (#2543)

## Documentation

- `my_first_fcn()` documentation updated to improve the clarity of the `@return` description, now stating: "A string with a welcome message 'Welcome to admiral!'". (#2593)

- `derive_locf_records()` documentation example was fixed to display LOCF records. (#2461)
- The "Find my function" and "Presentation Archive"" links were made more prominent in the website navigation bar. (#2536)

Expand Down
10 changes: 10 additions & 0 deletions R/my_first_fcn.R
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luenhchang your test will keep failing as your function produces something slightly different than what you are testing
image

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#' My First Function
#'
#' This function outputs a welcome message for onboarding purposes.
#'
#' @return A string with a welcome message "Welcome to admiral!"
#' @export
#'
my_first_fcn <- function() {
"Welcome to admiral!"
}
14 changes: 14 additions & 0 deletions man/my_first_fcn.Rd

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

5 changes: 5 additions & 0 deletions tests/testthat/test-my_first_fcn.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test_that("my_first_fcn works correctly", {
result <- my_first_fcn()
expect_type(result, "character") # Test that the output is a string
expect_equal(result, "Welcome to the admiral family!") # Test the exact content
})
Loading