0
0
R Programmingprogramming~10 mins

Transpose and inverse in R Programming - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to transpose matrix m.

R Programming
t_m <- [1](m)
Drag options to blanks, or click blank then click option'
Atranspose
Bt
Cinv
Dsolve
Attempts:
3 left
💡 Hint
Common Mistakes
Using solve() instead of t() for transpose
Using inv() which is not a base R function
2fill in blank
medium

Complete the code to find the inverse of matrix m.

R Programming
inv_m <- [1](m)
Drag options to blanks, or click blank then click option'
Asolve
Binverse
Ct
Dinv
Attempts:
3 left
💡 Hint
Common Mistakes
Using t() which transposes, not inverts
Using inv() which is not a base R function
3fill in blank
hard

Fix the error in the code to correctly compute the inverse of matrix m.

R Programming
inverse_m <- [1](m)
Drag options to blanks, or click blank then click option'
Atranspose
Binv
Ct
Dsolve
Attempts:
3 left
💡 Hint
Common Mistakes
Using inv() which is not defined
Using t() which transposes instead of inverts
4fill in blank
hard

Fill both blanks to create a matrix m and then transpose it.

R Programming
m <- matrix(c(1, 2, 3, 4), nrow = [1], ncol = [2])
t_m <- t(m)
Drag options to blanks, or click blank then click option'
A2
B3
C4
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Setting nrow or ncol incorrectly causing dimension mismatch
5fill in blank
hard

Fill all three blanks to create a matrix, find its inverse, and then transpose the inverse.

R Programming
m <- matrix(c(4, 7, 2, 6), nrow = [1], ncol = [2])
inv_m <- [3](m)
t_inv_m <- t(inv_m)
Drag options to blanks, or click blank then click option'
A2
Csolve
Dt
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong dimensions for the matrix
Using t() instead of solve() for inversion