https://github.com/cran/multivariance
Raw File
Tip revision: e0320c9516346f2d4fe715a5eb662d6aa790a6cb authored by Björn Böttcher on 04 January 2019, 23:20:03 UTC
version 1.2.1
Tip revision: e0320c9
sample.cols.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/multivariance-functions.R
\name{sample.cols}
\alias{sample.cols}
\title{resample the columns of a matrix}
\usage{
sample.cols(x, vec = 1:ncol(x), replace = TRUE)
}
\arguments{
\item{x}{matrix}

\item{vec}{vector, indicates which columns belong together}

\item{replace}{boolean, sampling with or without replacement}
}
\value{
Returns a matrix with the same dimensions as \code{x}. The columns are resampled from the original columns. The resampling is done with replacement (\code{replace = TRUE}) or without (\code{replace = FALSE}). Columns which belong together (indicated by vec) are resampled identically, i.e., all values in rows of these are kept together.
}
\description{
resample the columns of a matrix
}
\examples{
sample.cols(matrix(1:15,nrow = 5),vec = c(1,1,2))

}
back to top