0

I've progressed a bit with R but have been "slacking" or fogetting about the more basic functions. The issue I'm having now is using the new function learned "pivot_longer" I've adjusted my dataset so that its more workable finding the fastest lap-time.

The question at hand is : Find out who has the fastest lap time. I've tried using max() or which.max() which only printed out the actual max time of the column I selected.

How can I get a print that looks as follows "Lap - Name - Fastest Lap time" ?

My code:

library(tidyr)
library(dplyr)
    
Mugello<- Mugello %>% pivot_longer(cols = 3:22)
which.max(Mugello$value)
Mugello[max(Mugello$value)]

Image of my dataset

enter image description here

Darren Tsai
  • 32,117
  • 5
  • 21
  • 51

0 Answers0