Categories

Jul 28, 2019 in R Language

Q: Two vectors X and Y are defined as follows – X <- c(3, 2, 4) and Y <- c(1, 2). What will be output of

vector Z that is defined as Z <- X*Y.

1 Answer

Jul 28, 2019
In R language when the vectors have different lengths, the multiplication begins with the smaller vector and continues till all the elements in the larger vector have been multiplied.

The output of the above code will be –

Z <- (3, 4, 4)
Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

Madanswer
Jul 28, 2019 in R Language
Jul 28, 2019 in R Language
Jul 28, 2019 in R Language
...