powered by
A dataset is converted to a data matrix. A single data item (i.e. a simple vector) is converted to a one-row data matrix.
oneOrDataset(W,B=NULL)
A data matrix containing the same data as W. If W is a vector it is interpreded as a single row. If B is given and
B
length(dim(B))!= 2 and W is a vector, then W is repeated nrow(B) times.
length(dim(B))!= 2
W
nrow(B)
a vector, matrix or dataframe
an optional second vector, matrix or data frame having the intended number of rows.
K.Gerald v.d. Boogaart http://www.stat.boogaart.de
oneOrDataset(c(1,2,3)) oneOrDataset(c(1,2,3),matrix(1:12,nrow=4)) oneOrDataset(data.frame(matrix(1:12,nrow=4)))
Run the code above in your browser using DataLab