Question: 1. A) Make a vector called v1 that contains all multiples of 3 from 18 to 180. B) Compute the sum of the elements in

1.

A) Make a vector called v1 that contains all multiples of 3 from 18 to 180.

B) Compute the sum of the elements in v1.

C) Compute the average (mean) of the elements in v1.

R code here:

2.

A) Make a vector containing the integers from 1000 to 1 (decreasing), give it the name w.

B) Using w, make a vector w2 that only contains those elements of w that are NOT a multiple of 7.

C) Using w or w2, make a vector w3 that only contains those elements of w that are NEITHER a multiple of 7 or 9.

R code here:

3.

A) Make a vector p1 that contains the first 20 powers of 2 (2, 4, 8 etc.).

B) Make a vector p2 that contains the first 20 squares (1, 4, 9 etc.).

C) Make a 2-by-10 matrix (2 rows, 10 columns) whose first row is p1 and the second row is p2.

D) Make a 10-by-3 matrix whose first column is p1, the second column is p2 and the third column is all 0.

R code here:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!