Last answered:

02 Jul 2020

Posted on:

17 Jun 2020

0

Introduction to R programming

Can someone explain to me why this is marked as wrong. (See the attached). thanks

 

R Programming Quiz


1 answers ( 0 marked as helpful)
Instructor
Posted on:

02 Jul 2020

0

Hi Michael,
thanks for reaching out! Let's go through the different answers.

1. 'Vectors are a sequence of data elements that are of the same type' - is correct.

2. 'Multiplying two vectors returns a matrix' - The multiplication of two vectors doesn't always return a matrix, it could return only a single value(technically a single value could also be seen as 1x1 matrix, so this answer isn't posed completely correctly).
3. 'R returns an error message if you try to do operations on vectors of different lengths' - When it comes to multiplying vectors of different lengths, R doesn't throw an error. Instead it does so called 'recycling', i.e. recycles the shorter of the two vectors to match the length of the longer one and perform the operation.
4. 'All of the above'. We've discussed that 2 and 3 are not true. => Only the first of the four answers is strictly true.

Best,
365 Eli

Submit an answer