# # # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- # fix the random.seed, so I'll always get the same answer: set.seed(10131985) x = rnorm(10) x indsLT = x < -0.25 # less than -0.25 indsLT indsGT = x > +0.25 # greater than +0.25 indsGT indsLT | indsGT # all points such that abs(value)>0.25 indsLT & indsGT # no points (all elements FALSE) # return "or" of first element (indsLT[1]=TRUE) *or* (indsGT[1]=FALSE) = TRUE indsLT || indsGT # return "and" of first element (indsLT[1]=TRUE) *and* (indsGT[1]=FALSE) = FALSE indsLT && indsGT