R/RcppExports.R

Defines functions opls column_sums Q s2 colsds getMCCV_cpp sample_lapply unlist_cpp split_str order_cpp order_str rcpp_rmse sample_cpp sort_str

Documented in colsds column_sums getMCCV_cpp opls order_cpp order_str Q rcpp_rmse s2 sample_cpp sample_lapply sort_str split_str unlist_cpp

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

#' @title sort string
#' @keywords internal 
#' @useDynLib o2plsda
#' @return A vector of string
sort_str <- function(strings) {
    .Call('_o2plsda_sort_str', PACKAGE = 'o2plsda', strings)
}

#' @title sampling a vector
#' @keywords internal 
#' @useDynLib o2plsda
#' @return a vector of length ‘size’ with element drawn from ‘x’
sample_cpp <- function(x, n) {
    .Call('_o2plsda_sample_cpp', PACKAGE = 'o2plsda', x, n)
}

#' @title calculate RMSE
#' @keywords internal 
#' @useDynLib o2plsda
#' @return root-mean-square error value
rcpp_rmse <- function(y, y_hat) {
    .Call('_o2plsda_rcpp_rmse', PACKAGE = 'o2plsda', y, y_hat)
}

#' @title order a vector of sting
#' @keywords internal 
#' @useDynLib o2plsda
#' @return An character vector 
order_str <- function(x) {
    .Call('_o2plsda_order_str', PACKAGE = 'o2plsda', x)
}

#' @title order a vector
#' @keywords internal 
#' @useDynLib o2plsda
#' @return a integer vector
order_cpp <- function(x) {
    .Call('_o2plsda_order_cpp', PACKAGE = 'o2plsda', x)
}

#' @title split a vector
#' @keywords internal 
#' @useDynLib o2plsda
#' @return a list of vectors containing the values for the groups
split_str <- function(x) {
    .Call('_o2plsda_split_str', PACKAGE = 'o2plsda', x)
}

#' @title unlist a list
#' @keywords internal 
#' @useDynLib o2plsda
#' @return a vector of an appropriate mode to hold the list components.
unlist_cpp <- function(list) {
    .Call('_o2plsda_unlist_cpp', PACKAGE = 'o2plsda', list)
}

#' @title lapply sampling
#' @keywords internal 
#' @useDynLib o2plsda
#' @return a list
sample_lapply <- function(X, n) {
    .Call('_o2plsda_sample_lapply', PACKAGE = 'o2plsda', X, n)
}

#' @title MCCV sampling
#' @keywords internal 
#' @useDynLib o2plsda
#' @return a vector with random sampling based on group-balanced Monte Carlo cross-validation
getMCCV_cpp <- function(x, n) {
    .Call('_o2plsda_getMCCV_cpp', PACKAGE = 'o2plsda', x, n)
}

#' @title get the sd for a matrix
#' @keywords internal 
#' @useDynLib o2plsda
#' @return standard deviation of the matrix 
colsds <- function(X) {
    .Call('_o2plsda_colsds', PACKAGE = 'o2plsda', X)
}

#' @title sum square of a matrix
#' @keywords internal 
#' @useDynLib o2plsda
#' @return sum square value of the vector
s2 <- function(x) {
    .Call('_o2plsda_s2', PACKAGE = 'o2plsda', x)
}

#' @title calcualte the Q value
#' @keywords internal 
#' @useDynLib o2plsda
#' @return a numeric
Q <- function(y, y_hat) {
    .Call('_o2plsda_Q', PACKAGE = 'o2plsda', y, y_hat)
}

#' @title get the total values for a matrix
#' @keywords internal 
#' @useDynLib o2plsda
#' @return sum value of the column
column_sums <- function(X) {
    .Call('_o2plsda_column_sums', PACKAGE = 'o2plsda', X)
}

#' @title orthogonal scores algorithn of partial leat squares (opls) projection
#' @keywords internal 
#' @useDynLib o2plsda
#' @return a list of opls result
opls <- function(X, Y, ncomp, maxiter, tol) {
    .Call('_o2plsda_opls', PACKAGE = 'o2plsda', X, Y, ncomp, maxiter, tol)
}

Try the o2plsda package in your browser

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

o2plsda documentation built on Sept. 11, 2024, 8:28 p.m.