Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
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.
Home
R Language
Two vectors X and Y are defined as follows – X <- c(3, 2, 4) and Y...
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
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)
Related questions
+2
votes
There is a function fn(a, b, c, d, e) a + b * c - d / e. Write the code to call fn on the vector c(1,2,3,4,5) such that the output is same as fn(1,2,3,4,5).
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
+2
votes
If you want to know all the values in c (1, 3, 5, 7, 10) that are not in c (1, 5, 10, 12, 14). Which in-built function in R can be used to do this? Also, how this can be achieved without using the in-built function.
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
+2
votes
What will be the class of the resulting vector if you concatenate a number and a logical?
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
+2
votes
What will be the class of the resulting vector if you concatenate a number and a character?
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
+2
votes
What will be the class of the resulting vector if you concatenate a number and NA?
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
+2
votes
How will you check if an element 25 is present in a vector?
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
+2
votes
What will be the output of the below code -
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
0
votes
What will be the output of log (-5.8) when executed on R console?
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
+2
votes
Write a function in R language to replace the missing value in a vector with the mean of that vector.
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
+2
votes
How can you verify if a given object “X” is a matrix data object?
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
+2
votes
How can you verify if a given object “X” is a matric data object?
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
+2
votes
Which function in R language is used to find out whether the means of 2 groups are equal to each other or not?
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
+2
votes
What is the value of f (2) for the following R code?
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
+2
votes
Write code to build an R function powered by C?
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
+2
votes
How will you create scatterplot matrices in R language?
asked
Jul 28, 2019
in
R Language
by
Aarav2017
#r-language
#r-programming
#r-course
#r-tutorial
#r-question-answer
#r-interview-question
#r-basics
#r-test
#what-is-r
#learn-r
...