inst/snippet/vectors04b.R

x <- seq(2,20,by=2)
x[c(TRUE,TRUE,FALSE)]        # skips every third element (recycling!)
x[x > 10]                    # more typical use of boolean in selection

Try the fastR package in your browser

Any scripts or data that you put into this service are public.

fastR documentation built on May 2, 2019, 5:53 p.m.