Question: Here are the instructions for the code I need to write in R. Repeat the vector c(-1,3,-5,7,-9) twice, with each element repeated 10 times, and

Here are the instructions for the code I need to write in R. Repeat the vector c(-1,3,-5,7,-9) twice, with each element repeated 10 times, and store the result. Display the result sorted from largest to smallest.

This is the code I wrote and it was able to run. However, I need to find the length of the vector. I keep getting 100 but I am not sure if that is correct. How can I check and verify?

rep(c(-1,3,-5,7,-9),times=2,each=10) x<-rep(c(-1,3,-5,7,-9),times=2,each=10) sort(x,decreasing=TRUE)

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 Mathematics Questions!