How can I replace matrix values below a threshold with their row labels?
I have a numeric matrix where each row represents an object and the row label is its name. I want to create a display matrix: values below 4 should become the corresponding row label, while all other values should keep their original text representation. The output can be a string matrix. I also need to keep the original numeric matrix for further calculations. Here is a minimal example without null values: // Each vector passed to matrix becomes a column m = matrix(1 5 3, 2 6 4, 7 8 9) labels = ["A", "B", "C"] rename!(m, labels, `c1`c2`c3) m Input: c1 c2 c3 A 1 2 7 B 5 6 8 C 3 4 9 Expected ou
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.