sprintf("%.2f", fraction) On Nov 25, 2007 10:00 PM, Georg Ehret <[EMAIL PROTECTED]> wrote: > Dear R comunity, > I am printing a number in a graph using "text(...)" - see code > below: "fraction" is my number. I wish to print only two digits of the > number and struggle to do this... options(digit=3) does not work... > Thank you for your suggestions! Cheers, Georg. > > ********************************** > Georg Ehret > Johns Hopkins > Baltimore > > callrates<-read.table("RSG",col.names=c("variant","callrate")) > hist(callrates[,2],breaks=100) > fraction<-nrow(callrates[callrates$callrate>=0.9,])/nrow(callrates) > hist(callrates[,2],breaks=100) > text(0.4,500,"proportion of callrates >= 0.9:") > text(0.4,450,fraction) > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.