Question: . Write an R script that stores following values in a vector x: 1 5 , 2 3 , 4 4 , 3 8 ,

. Write an R script that stores following values in a vector x: 15,23,44,38,7,6,35,69,58,47.
b. Print the length of the vector x.
c. Print the last five elements of the vector x.
d. Find the minimum and maximum element in the vector x and remove them from the vector
x.
e. Change the first three elements with 10. When you print the vector x, it should include 1010
10387355847.
f. Add 3 to all elements of the vector x and store new values in the same vector. When you print
the vector x, it should include 1313134110386150.
g. Print all elements of x greater than 20.
h. Append all odd numbers between 30 and 50 to the vector x. Print the vector x.
i. Print all numbers in x in decreasing order.
j. Print all unique numbers in x.
k. Compute and print the following sum: 3+6+9+....+3000

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!