0

I have the following dataframe: enter image description here

I would like to create a table of the column headers, in a column with their maximum value to the right of them. I will be looking to embed this in a Shiny App. Does anyone know how I can do this?

Gary
  • 2,137
  • 3
  • 23
  • 41

1 Answers1

0

I used:

colMax <- function(data) sapply(data, max, na.rm=TRUE)

Then I called as.data.frame(colmax(data)) and it worked as needed.

Duplicate: How to find the highest value of a column in a data frame in R?

Community
  • 1
  • 1
Gary
  • 2,137
  • 3
  • 23
  • 41