+3 votes
in R Language by
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

0 votes
by
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)

Related questions

+2 votes
asked Jul 28, 2019 in R Language by Aarav2017
+2 votes
asked Jul 28, 2019 in R Language by Aarav2017
...