so, the idea with vectorized operations

is, is that things can happen in parallel,

when you, for example want to do a computation.

For example, suppose I got two vectors here x and y.

x is the sequence one through four and y is the sequence six through nine.

And I want to add the two vectors together.

Now, when I say I want to add them, what I mean

is I want to add the first element of x to the

first element of y, the second element of x to the second

element of y, et cetera, the third element to the third element.

So I want to kind of do things in parallel like that.

So, in other languages you might have to use a loop to do that,

so you'd loop through each element and kind of add them one by one.

But in R you can just use the plus to, on the two vectors, and

it'll just add them together so x plus y kind of does what you would expect.

It adds 1 to 6, 2 to 7, 3 to 8, and 4 to 9, so you get the vector 7, 9, 11, 13.

similarly, you can use the greater than, or

less than symbols to, give you logical vectors.

For example, x greater than 2.

So well x is actually a, a vector of 4 numbers.

So, which one, so, which number are you comparing to 2?

Well, the, the vectorized operation compares all

the numbers to 2, and it gives you

a vector of falses and trues depending on which numbers happen to be bigger than 2.

So you can also use greater than equal to,

and that'll tell you which numbers are greater than and

equal to 2, and the double equals sign, tests for equality.

So it'll take each element of y and test to see whether it's equal to 8.

other, and the other kind of,

or arithmetic operations like multiplication, by

the asterisk, and division, by the

solidus, are all vectorized types of operation.

So when you want to multiply or divide, add,

subtract, vectors, you just you can do the natural

thing, just add them together or multiply them together, and they will

be, and they will be the operation will be done in parallel.