R/RcppExports.R

Defines functions GiStepWisePure characterDict dataFramToNumeric characterToInteger

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

#' Character vector to Integer vector use Rcpp
#'
#' @param x original character vector
#' @param levels the unique value form x, where the index is the output integer vector value
#' @return integer vector
#' @noRd
characterToInteger <- function(x, levels) {
    .Call(`_MrSGUIDE_characterToInteger`, x, levels)
}

#' R dataframe to numeric vector
#'
#' Function will change the original numerical dataframe to a numerical matrix, where missing value will change to Inf.
#'
#' @param numX numerical dataframe
#' @return numerical matrix
#' @noRd
dataFramToNumeric <- function(numX) {
    .Call(`_MrSGUIDE_dataFramToNumeric`, numX)
}

#' Character or factor dataframe change to integer matrix.
#'
#' Character dataframe, for each column, use \code{characterToInteger()} with unique value from character vector
#'
#' @param charX character dataframe or factor dataframe
#' @param levels, the desired levels for each character vector
#' @return list intX the integer matrix x, with corresponding levels.
#' @noRd
characterDict <- function(charX, levels) {
    .Call(`_MrSGUIDE_characterDict`, charX, levels)
}

#' MrSGUIDE C++ function
#'
#' @title MrSGUIDE stepwise
#'
#' @author Peigen Zhou
#'
#'
#' @param numX numerical X matrix
#' @param catX categorical X matrix
#' @param Y outcome Y matrix
#' @param trt treatment vector
#' @param splitIndex variable used for split
#' @param fitIndex variables can be used for fit
#' @param holdIndex variable must include in the fitting model
#' @param bestK maximal number of variables used in the outcome model for prognostic control
#' @param maxDepth maximal depth
#' @param minData minimum sample in each node
#' @param minTrt minimum treatment and placebo sample in each node
#' @param batchNum related with exhaustive search for numerical split variable
#' @param CVFold cross validation times
#' @param CVSE cross validation SE
#' @param bootNum bootstrap number
#' @param alpha desire alpha levels for confidence interval with respect to treatment parameters
#' @param faster related with tree split searching
#' @param display Whether display tree in the end
#' @param varName variable names
#' @param treeName yaml file for save the tree
#' @param nodeName file same for each node
#' @param bootName file save bootstrap calibrate alpha
#' @param impName important variable file name
#' @noRd
#'
GiStepWisePure <- function(numX, catX, Y, trt, splitIndex, fitIndex, holdIndex, bestK, maxDepth, minData, minTrt, batchNum, CVFold, CVSE, bootNum, alpha, faster, display, varName, treeName, nodeName, bootName, impName) {
    invisible(.Call(`_MrSGUIDE_GiStepWisePure`, numX, catX, Y, trt, splitIndex, fitIndex, holdIndex, bestK, maxDepth, minData, minTrt, batchNum, CVFold, CVSE, bootNum, alpha, faster, display, varName, treeName, nodeName, bootName, impName))
}

Try the MrSGUIDE package in your browser

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

MrSGUIDE documentation built on Oct. 23, 2020, 5:19 p.m.