Re: show for phenoData
0
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 18 hours ago
United States
On Tue, 19 Mar 2002, Rafael A. Irizarry wrote: > show for "empty" phenoData gives errors: > > > new("phenoData") > phenoData object with variables and cases > varLabels > Error in vL[[i]] : subscript out of bounds ok, but a better approach is to introduce a validity checking method to prevent such phenoData objects from ever being created see setValidity under methods we need to get into this habit. > > > here is an easy fix adding a if-else > > setMethod("show", "phenoData", > function(object) { > dm <- dim(object@pData) > if(is.null(dm)) cat("Empty\n") > else{ > cat("\t phenoData object with ", dm[2], " variables", > sep="") > cat(" and ", dm[1], " cases\n", sep="") > vL <- object@varLabels > cat("\t varLabels\n") > nm <- names(vL) > for(i in 1:length(vL) ) > cat("\t\t", nm[[i]], ": ", vL[[i]], "\n", sep="") > } > }, where=where) > > > > _______________________________________________ > Biocore mailing list > Biocore@stat.math.ethz.ch > http://www.stat.math.ethz.ch/mailman/listinfo/biocore >
• 1.1k views
ADD COMMENT

Login before adding your answer.

Traffic: 1147 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6