inst/template/R/myrnorm.R

#' Sample from the Normal Distribution
#'
#' This is a simple little function that demonstrates calling a 'Rust' function.
#' It generates samples from the normal distribution.
#'
#' @param n An integer for the number of random samples.
#' @param mean A scalar giving the mean.
#' @param sd A scalar giving the standard deviation.
#'
#' @return A numeric vector.
#' @export
#' @examples
#' myrnorm(10, 5, 4)
myrnorm <- function(n, mean, sd) {
  .Call(.myrnorm, n, mean, sd)
}

Try the cargo package in your browser

Any scripts or data that you put into this service are public.

cargo documentation built on July 26, 2023, 5:20 p.m.