R/c_test.R

Defines functions c_test

Documented in c_test

#' R frontend of the C function bar
#' 
#' A mask function to test if the dummy C code in src/bar.c 
#' works. 
#' 
#' \code{c_test(x)} = x^2.
#' 
#' @param x a numeric vector
#' 
#' @return a numeric vector x^2
#' 
#' @examples 
#' 
#' \dontrun{
#'   x <- rnorm(10)
#'   c_test(x)
#' }  
#' 
c_test <- function(x) {
    stopifnot(is.numeric(x))
    out <- .C(C_bar, x = as.double(x), n = length(x))
    return(out$x)
}

Try the rdoxygen package in your browser

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

rdoxygen documentation built on May 2, 2019, 11:04 a.m.