Bonjour,
Pourquoi ne pas faire quelque chose de plus simple comme ceci :
En partant directement de ton fichier :
Code : Tout sélectionner
tab <- read.table("clipboard", h = T, sep = ";", stringsAsFactors = F)
tab$time <- strptime(tab$HEURE, format = "%HH %MM 0S")
Ce qui donne ça comme objet :
Code : Tout sélectionner
tab <- structure(list(HEURE = c("4H 21M 0S", "14H 13M 0S", "14H 58M 0S",
"15H 35M 0S", "19H 19M 0S", "21H 41M 0S"), Releve = c(44L, 52L,
87L, 27L, 74L, 18L), time = structure(list(sec = c(0, 0, 0, 0,
0, 0), min = c(21L, 13L, 58L, 35L, 19L, 41L), hour = c(4L, 14L,
14L, 15L, 19L, 21L), mday = c(26L, 26L, 26L, 26L, 26L, 26L),
mon = c(5L, 5L, 5L, 5L, 5L, 5L), year = c(119L, 119L, 119L,
119L, 119L, 119L), wday = c(3L, 3L, 3L, 3L, 3L, 3L), yday = c(176L,
176L, 176L, 176L, 176L, 176L), isdst = c(1L, 1L, 1L, 1L,
1L, 1L), zone = c("CEST", "CEST", "CEST", "CEST", "CEST",
"CEST"), gmtoff = c(NA_integer_, NA_integer_, NA_integer_,
NA_integer_, NA_integer_, NA_integer_)), .Names = c("sec",
"min", "hour", "mday", "mon", "year", "wday", "yday", "isdst",
"zone", "gmtoff"), class = c("POSIXlt", "POSIXt"))), .Names = c("HEURE",
"Releve", "time"), row.names = c(2L, 4L, 1L, 5L, 3L, 6L), class = "data.frame")
Le graphe :
Si tu veux relier les points, un petit tri préalable :
Code : Tout sélectionner
tab <- tab[order(tab$time),]
plot(tab$time, tab$Releve, type = "b")
Comme cela me parait très simple, je suis peut être passé à coté de quelque chose