Description Usage Arguments Value Author(s) See Also Examples
Coerce a matrix (back) to class
of some other object
1 2 3 4 5 6 | ## S3 method for class 'numdfr'
matBack2OrgClass(objWithClass, mat, catCols, levelList, ord=rep(FALSE, ncol(mat)),
colnms=NULL, verbosity=0)
## S3 method for class 'data.frame'
matBack2OrgClass(objWithClass, mat, catCols, levelList, ord=rep(FALSE, ncol(mat)),
colnms=NULL, verbosity=0)
|
objWithClass |
object to dispatch class upon |
mat |
matrix to coerce (back) to format/class of |
catCols |
indices of categorical columns |
levelList |
list of character vectors holding the labels for categorical columns |
ord |
logical vector indicating whether each column is an ordered factor |
colnms |
columnn names to use (if not the original ones - default is |
verbosity |
The higher this value, the more levels of progress and debug information is displayed (note: in R for Windows, turn off buffered output) |
object of the same class as objWithClass
Nick Sabbe
1 2 3 4 5 6 7 8 9 | iris.nd<-numdfr(iris)
irismat<-as.nummatrix(iris)
irismat<-irismat[sample(nrow(irismat), 20, replace=TRUE),]
rownames(irismat)<-seq(20)
ccs<-which(sapply(iris, is.factor))
lvls<-allLevels(iris, onlyNonEmpty=TRUE)
matBack2OrgClass(iris, irismat, catCols=ccs, levelList=lvls, verbosity=5)
matBack2OrgClass(iris.nd, irismat, catCols=ccs, levelList=lvls, verbosity=5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.