> # create a new vector (c as in combine)
> vec = c(2, 4, 5, 234, 2)
>
> # create another vector
> vec2 = vec * 2
> vec2
[1] 4 8 10 468 4
>
> # index selector
> vec3 = vec2[vec2 < 100]
> vec3
[1] 4 8 10 4
>
> # let's treat a vector as a set for a moment
> set = unique(vec3)
> set
[1] 4 8 10
>
> # I guess it might be cool to get sqrt of each item
> sapply(set, sqrt)
[1] 2.000000 2.828427 3.162278
>
> # "c" works with multiple vectors too
> vec4 = c(vec2, vec3)
> vec4
[1] 4 8 10 468 4 4 8 10 4
>
> # let's select just four first items (note the indexing!)
> vec4[1:3]
[1] 4 8 10
>
> # get first three items in reverse
> vec4[3:1]
[1] 10 8 4
>
> # get vector without those fours in the middle (note the -!)
> vec4[-c(5, 6)]
[1] 4 8 10 468 8 10 4