Faire un calcul avec une variable date ou heure dans R
Faire un calcul avec une variable date ou heure dans R
Catégorie du document :
Articles web, Sites internet
Date du jour :
15.08.2021
Catégorie :
Statistiques R
A retenir :
f# Get sample of 'Date/Time Type' x <- c("01:03:55", "01:03:57", "01:06:18", "01:09:33") # Convert to proper format y <- as.POSIXct(x, format = "%H:%M:%S") # Find the median y <- median(y) # Updated, no need to use strsplit and sapply, directly use format # ys <- strsplit(as.character(y), split = " ") # sapply(ys, function(x) x[2]) # Get the time format(y,"%H:%M:%S" ) [1] "01:05:07"