The R Project SVN R

Rev

Rev 61153 | Rev 74377 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61153 Rev 61168
Line 68... Line 68...
68
  Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
68
  Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
69
  \emph{The New S Language}.
69
  \emph{The New S Language}.
70
  Wadsworth & Brooks/Cole.
70
  Wadsworth & Brooks/Cole.
71
}
71
}
72
\examples{
72
\examples{
73
pretty(1:15)     # 0  2  4  6  8 10 12 14 16
73
pretty(1:15)          # 0  2  4  6  8 10 12 14 16
74
pretty(1:15, h = 2)# 0  5 10 15
74
pretty(1:15, h = 2)   # 0  5 10 15
75
pretty(1:15, n = 4)# 0  5 10 15
75
pretty(1:15, n = 4)   # 0  5 10 15
76
pretty(1:15 * 2) # 0  5 10 15 20 25 30
76
pretty(1:15 * 2)      # 0  5 10 15 20 25 30
77
pretty(1:20)      # 0  5 10 15 20
77
pretty(1:20)          # 0  5 10 15 20
78
pretty(1:20, n = 2) # 0 10 20
78
pretty(1:20, n = 2)   # 0 10 20
79
pretty(1:20, n = 10)# 0  2  4 ... 20
79
pretty(1:20, n = 10)  # 0  2  4 ... 20
80
 
80
 
81
for(k in 5:11) {
81
for(k in 5:11) {
82
  cat("k=",k,": "); print(diff(range(pretty(100 + c(0, pi*10^-k)))))}
82
  cat("k=", k, ": "); print(diff(range(pretty(100 + c(0, pi*10^-k)))))}
83
 
83
 
84
##-- more bizarre, when  min(x) == max(x):
84
##-- more bizarre, when  min(x) == max(x):
85
pretty(pi)
85
pretty(pi)
86
 
86
 
87
add.names <- function(v) { names(v) <- paste(v); v}
87
add.names <- function(v) { names(v) <- paste(v); v}