You are talking about medians of columns in the header, but the example leads to the row-wise medians, as in your other question. If you want the column-wise medians HERE you need to change the margin in the apply() command, i.e.
apply(Tgiven, 2, FUN = median)
You can find the explanation
"E.g., for a matrix 1 indicates rows, 2 indicates columns, c(1, 2)"
in
?apply
So another possible solution to your other question (and to the example given in THIS question) would have been apply(Tgiven, 1, FUN = median)
Jimmy, you should learn R yourself. Read the good and free online books, or buy one, or watch some tutorial on youtube. You are continuously asking the same question over and over again!
You are talking about medians of columns in the header, but the example leads to the row-wise medians, as in your other question. If you want the column-wise medians HERE you need to change the margin in the apply() command, i.e.
apply(Tgiven, 2, FUN = median)
You can find the explanation
"E.g., for a matrix 1 indicates rows, 2 indicates columns, c(1, 2)"
in
?apply
So another possible solution to your other question (and to the example given in THIS question) would have been apply(Tgiven, 1, FUN = median)