How to find the max value of a specific column in a matrix

Viewed 471

I am new to R. Many thanks in advance for your help.

I am trying to find the maximum value of a single (the first) column in a matrix, "bin.matrix". Of course, I have been able to find the max value for all columns using:

apply(bin.matrix, 2, max)

But I can't seem to figure out how to get the value for just the first column. It's a homework question, so just reading the first value won't do unfortunately. The next question asks for the max value in all but the first column.

Thanks again for your help.

1 Answers

We can select the first column by subsetting with numeric index and get the max

max(bin.matrix[,1])
Related