# The 'size' function
# Written by Kevin Potter
# email: kevin.w.potter@gmail.com
# Please email me directly if you
# have any questions or comments
# Last updated 2018-10-10
# Table of contents
# 1) size | no test needed
###
### 1) size
###
#' Size of \code{binclass} Objects
#'
#' Generic function to determine the size
#' (i.e., length, number of rows or columns)
#' of various \code{binclass} objects.
#'
#' @param x An R object. Currently there are methods for
#' \code{train_tst} and \code{bc_simulate}.
#' @param ... Further arguments passed to or from other
#' methods.
#'
#' @return The length or dimensions of the \code{binclass}
#' object.
#'
#' @export
#' @examples
#' # Simulate data
#' sim = bc_simulate( 400, 8, 4 )
#' size( sim ) == 400; size( sim, F ) = c( 400, 8 )
#' # Split into training and test subsets
#' index = cv_index( 3, 400 )
#' dat = train_test( 3, index, sim$y, sim$X )
#' size( dat ) == 267; size( dat, F ) == c( 267, 8 )
#' size( dat, train = F ) == 133; size( dat, F, F ) == c( 133, 8 )
size = function( x, ... ) {
UseMethod("size", x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.