% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CST_ReorderDims.R
\name{CST_ReorderDims}
\alias{CST_ReorderDims}
\title{Reorder the dimensions of an s2dv_cube}
\usage{
CST_ReorderDims(x, order)
}
\arguments{
\item{x}{An array of which the dimensions to be reordered.}

\item{order}{A vector of indices or character strings indicating the new 
order of the dimensions.}
}
\value{
An s2dv_cube which has the data and information as parameter 'x',
 but with different dimension order.
}
\description{
Reorder the dimensions of an s2dv_cube. The order can be provided
either as indices or the dimension names. If the order is dimension names, 
the function looks for names(dim(x)). If it doesn't exist, the function checks
if attributes "dimensions" exists; this attribute is in the objects generated
by Load().
}
\examples{
# Example with sample data:
# Check original dimensions and coordinates
lonlat_temp$exp$dims
names(lonlat_temp$exp$coords)
# Reorder the s2dv_cube
new_order <- c("dataset", "member", "sdate", "ftime", "lon", "lat")
res <- CST_ReorderDims(x = lonlat_temp$exp, order = new_order)
# Check new dimensions and coordinates
dim(res$data)
res$dims
names(res$coords)

}
\seealso{
\link[s2dv]{Reorder}
}
