Login
Remember
Register
Ask a Question
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.
+3
votes
asked
Jul 28, 2019
in
R Language
by
Aarav2017
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.
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jul 28, 2019
by
SakshiSharma
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)
...