On Nov 10, 2010, at 5:13 AM, Jim Lemon wrote:
On 11/10/2010 07:55 PM, Santosh Srinivas wrote:
Basic question ... checked the help page but the only answer was to
use
paste!
Is there any way to format as %?
> sprintf("%1.0f %%",10)
[1] "10 %"
> sprintf("%1.0f%%",10)
[1] "10%"
degree = c(0.20,0.5)
degree
[1] 0.2 0.5
print(degree)
[1] 0.2 0.5
Hi Santosh,
If you want to scale proportions to percentages, you probably want
this:
paste(100*degree,"%")
You may also have to look at rounding the result to avoid those awful
27.29387163%
outcomes.
Jim
______________________________________________
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.