R/RcppExports.R

Defines functions char2factor factor2char StringVectorExample RcppRNGs NumericVectorExample MatrixExample ListExamples DateExample DataFrameExample

Documented in char2factor factor2char

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

DataFrameExample <- function(DF) {
    .Call(`_RcppExamples_DataFrameExample`, DF)
}

DateExample <- function(dv, dtv) {
    .Call(`_RcppExamples_DateExample`, dv, dtv)
}

ListExamples <- function(rparam) {
    .Call(`_RcppExamples_ListExamples`, rparam)
}

MatrixExample <- function(orig) {
    .Call(`_RcppExamples_MatrixExample`, orig)
}

NumericVectorExample <- function(orig) {
    .Call(`_RcppExamples_NumericVectorExample`, orig)
}

RcppRNGs <- function(n) {
    .Call(`_RcppExamples_RcppRNGs`, n)
}

StringVectorExample <- function(orig) {
    .Call(`_RcppExamples_StringVectorExample`, orig)
}

#' Convert Index and String Vector into CharacterVector, and vice versa
#'
#' These two functions are an illustration of how \code{as.character} and
#' \code{as.factor} may be reimplemented at the C++ level.
#' @param iv A Integer Vector corresponding to numeric representation of the factor
#' This vector is also expected to have an attribute \sQuote{levels} with the factor
#' levels
#' @return A Character Vector which at each position contains the level value of the
#' corresponding index, or a Factor, depending on the function
#' @examples
#' f <- as.factor(c("red", "green", "blue", "red"))
#' factor2char(f);
factor2char <- function(iv) {
    .Call(`_RcppExamples_factor2char`, iv)
}

#' @rdname factor2char
#' @param sv A String Vector
#' @examples
#' f <- as.factor(c("red", "green", "blue", "red"))
#' v <- factor2char(f);
#' char2factor(v)
char2factor <- function(sv) {
    .Call(`_RcppExamples_char2factor`, sv)
}
eddelbuettel/rcppexamples documentation built on March 8, 2024, 1:37 p.m.