Skip to content
Draft
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
26 changes: 24 additions & 2 deletions R/example_function.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
#' Example Function
#' Example Function with Mathematical Notation
#'
#' This is an example function that demonstrates basic functionality.
#' This is an example function that demonstrates basic functionality and
#' various ways to include mathematical notation in roxygen2 documentation.
#'
#' # Mathematical Notation in roxygen2
#'
#' ## Using `\eqn{}` for inline math (works in all formats)
#'
#' The median is a measure of central tendency where \eqn{x_{0.5}} represents
#' the value that splits the data in half.
#'
#' ## Using `\deqn{}` for display equations (works in all formats)
#'
#' The sample median for odd \eqn{n} is defined as:
#' \deqn{m = x_{(n+1)/2}}
#'
#' ## Using `$$` for display math (HTML/pkgdown only, requires roxygen2 >= 7.0.0)

Check notice on line 18 in R/example_function.R

View check run for this annotation

codefactor.io / CodeFactor

R/example_function.R#L18

Lines should not be more than 80 characters. This line is 81 characters. (line_length_linter)

Check warning on line 18 in R/example_function.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/example_function.R,line=18,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 81 characters.
#'
#' For even sample sizes, the median is the average of the two middle values:
#' $$m = \frac{x_{(n/2)} + x_{(n/2+1)}}{2}$$
#'
#' ## Using `$` for inline math (HTML/pkgdown only, requires roxygen2 >= 7.0.0)
#'
#' In general, the median minimizes $\sum_{i=1}^{n} |x_i - m|$.
#'
#' @param x A numeric vector
#'
Expand Down
30 changes: 28 additions & 2 deletions man/example_function.Rd

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

Loading