A Classic Model of For-Loop with Jump-out If/Else in R

Write a conditional function that takes a square character matrix and checks if any of the character strings on the diagonal (top left to bottom right) begin with the letter g, lowercase or uppercase. If satisfied, these specific entries should be overwritten with the string "HERE". Otherwise, the entire matrix should be replaced with an identity matrix of the… Continue reading A Classic Model of For-Loop with Jump-out If/Else in R