Answered step by step
Verified Expert Solution
Question
1 Approved Answer
# ============================================================================== ## Factor # ============================================================================== # Create speed_vector speed_vector 4. Matrix Copy and Paste the Star Wars code above into your R and complete
# ============================================================================== ## Factor # ==============================================================================
# Create speed_vector
speed_vector
4. Matrix Copy and Paste the Star Wars code above into your R and complete the problem 4. (a) Use c(new_hope, empire_strikes, return_jedi) to combine the three vectors into one vector. Call this vector box_office. (b) Construct a matrix with 3 rows, where each row represents a movie. Name the resulting matrix star wars_matrix. (c) Use the function rowSums() to calculate worldwide box office figures. Name the vector worldwide_vector. (d) Use colnames() to name the columns of star wars_matrix with the regionvector, and use rownames () to name the rows of star_wars_matrix with the titles vector. Then print out star_wars_matrix. (e) Add worldwide_vector as a new column to the star wars_matrix and assign the result to all_wars_matrix. Print out all_wars_matrix Use the cbind() function. (f) Select the non-US revenue for first two movies. ## Factor # Create speed_vector speed_vector
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started