Skip to content

Commit dc5d34c

Browse files
committed
feat: dummy fcn
1 parent 3400b0f commit dc5d34c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

R/dummy_fcn.R

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#' Dummy Function Example
2+
#'
3+
#' @description
4+
#' This dummy function demonstrates how to document an R function using roxygen2.
5+
#' It takes two numeric inputs and returns their element-wise sum.
6+
#'
7+
#' @param a A numeric vector.
8+
#' @param b A numeric vector.
9+
#'
10+
#' @return A numeric vector containing the element-wise sum of \code{a} and \code{b}.
11+
#'
12+
#' @examples
13+
#' # Basic addition with scalars
14+
#' dummy_function(1, 2)
15+
#'
16+
#' # Element-wise addition with vectors
17+
#' dummy_function(c(1, 2, 3), c(4, 5, 6))
18+
#'
19+
#' @export
20+
dummy_function <- function(a, b) {
21+
# Validate input types
22+
if (!is.numeric(a) || !is.numeric(b)) {
23+
stop("Both 'a' and 'b' must be numeric.")
24+
}
25+
26+
# Return the element-wise sum
27+
a + b
28+
}

0 commit comments

Comments
 (0)