Last chance! 50% off unlimited learning
Sale ends in
Rearranges data from a matrix or data frame into a matrix where data are tagged by their variables names as factors. Used to concatenate data for display with functions tbplots.by.var
and bwplots.by.var
.
var2fact(xmat)
name of the n
by p
data matrix or data frame to be processed.
a n * p
by 2
matrix where each of the n * p
rows contains a value that is paired with its variable name as a factor, see Note below.
If the data for only some of the variables available in an attached matrix or data frame are to be processed use the cbind
construct. Thus, temp.mat <- cbind(vname1, vname3, vname6, vname8)
.
# NOT RUN {
## Display, convert data frame and display the result
data(ms.data1)
ms.data1
temp <- var2fact(ms.data1)
temp
## Clean-up
rm(temp)
# }
Run the code above in your browser using DataLab