I'm not that good in programming R, maybe somebody can help me. I used pretty() function on some histograms (for breaks=) but sometimes got an error. Further testing brought me to following results:
pretty(-1:1,n=20)
[1] -1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
That's what I expected, also with the following line of code
pretty(-26:71,n=18)
[1] -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
BUT - here comes the problem, following pretty() usage brought a complete wrong result (not even getting above zero)
pretty(-0.26:0.71,n=10)
[1] -0.35 -0.30 -0.25 -0.20
Can anybody explain to me what I'm doing wrong ? Thanks for your help !
pretty(seq(-0.26, 0.71, .01), n=10)
.-0.26:0.71
is.equal to-.26
as:
makes a sequence with a step size of 1. – stefan