Code
library("rpt")
example_function(c(1, 2, 3, 4, 5))[1] 3
Code
example_function(c(1, NA, 3, 4, 5))[1] 3.5
This is an example function that demonstrates basic functionality. It validates, cleans, calculates statistics, and formats the result.
example_function(x)
x
|
A numeric vector |
This function also demonstrates various ways to include mathematical notation in roxygen2 documentation.
The median of the input vector, rounded to 2 decimal places
for inline math (works in all formats)
The median is a measure of central tendency where \(x_{0.5}\) represents the value that splits the data in half.
for display equations (works in all formats)
The sample median for odd \(n\) is defined as:
\(m = x_{(n+1)/2}\)
library("rpt")
example_function(c(1, 2, 3, 4, 5))[1] 3
example_function(c(1, NA, 3, 4, 5))[1] 3.5