The R Project SVN R

Rev

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

Rev 61150 Rev 61168
Line 67... Line 67...
67
v <- c(5, 10, 15) # create two bins [5,10) and [10,15)
67
v <- c(5, 10, 15) # create two bins [5,10) and [10,15)
68
cbind(x, findInterval(x, v))
68
cbind(x, findInterval(x, v))
69
 
69
 
70
N <- 100
70
N <- 100
71
X <- sort(round(stats::rt(N, df = 2), 2))
71
X <- sort(round(stats::rt(N, df = 2), 2))
72
tt <- c(-100, seq(-2,2, len = 201), +100)
72
tt <- c(-100, seq(-2, 2, len = 201), +100)
73
it <- findInterval(tt, X)
73
it <- findInterval(tt, X)
74
tt[it < 1 | it >= N] # only first and last are outside range(X)
74
tt[it < 1 | it >= N] # only first and last are outside range(X)
75
}
75
}
76
\keyword{arith}
76
\keyword{arith}
77
\keyword{utilities}
77
\keyword{utilities}