Answer only in R coding language, please. Thank you
Q1. Write a function margin_index_power() that takes as input a
matrix A and an argument rows, TRUE/FALSE with a default value of
TRUE. margin_index_power(A, rows = TRUE) outputs the matrix A with
the elements in the ith row of A taken to the ith power. If rows =
FALSE, then do the same but with the columns instead of rows of
A.
Please test your function on the following test inputs in your
submission:
Q2.
Write a function is_anti_diagonal() that takes as
input a matrix A and outputs TRUE if it is
anti-diagonal and FALSE otherwise. While you can
assume A is a matrix, you cannot assume that it is
square.
Q3.
Write a function called set_border_NA() that takes as
input a matrix A and outputs A with its borders
set to NA. If A has exactly one row or exactly one
column, throw an error of your choosing.
Answer only in R coding language, please. Thank you Q1. Write a function margin_index_power() that takes as input a matr
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Answer only in R coding language, please. Thank you Q1. Write a function margin_index_power() that takes as input a matr
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!