InsertDim.Rd 921 Bytes
Newer Older
aho's avatar
aho committed
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/InsertDim.R
\name{InsertDim}
\alias{InsertDim}
aho's avatar
aho committed
\title{Adds A Dimension To An Array}
InsertDim(var, posdim, lendim)
aho's avatar
aho committed
\item{var}{Matrix to which a dimension should be added.}

\item{posdim}{Position of the new dimension.}

\item{lendim}{Length of the new dimension.}
Matrix with the added dimension.
aho's avatar
aho committed
\description{
Inserts an extra dimension into an array at position 'posdim' with length 
'lendim' and which correspond to 'lendim' repetitions of the 'var' array.
}
aho's avatar
aho committed
a <- array(rnorm(15), dim = c(3, 1, 5, 1))
print(dim(a))
print(dim(a[, , , ]))
print(dim(InsertDim(InsertDim(a[, , , ], 2, 1), 4, 1)))
aho's avatar
aho committed

aho's avatar
aho committed
0.1  -  2011-03  (V. Guemas)  -  Original code\cr
1.0  -  2013-09  (N. Manubens)  -  Formatting to R CRAN\cr
1.1  -  2015-03  (N. Manubens)  -  Improvements