table2=function(data, classs) { nclass=length(classs) vec = rep(0,nclass) names(vec)=classs tdata=table(data) vec[names(tdata)]=as.numeric(tdata) return(vec) }
没有评论:
发表评论