Une manière de faire:
Code : Tout sélectionner
test$Index <- match(test$Com, unique(test$Com))
En espérant que tout va commme tu veux.
Aurélien
Code : Tout sélectionner
test$Index <- match(test$Com, unique(test$Com))
Code : Tout sélectionner
X <- 1:10
Y <- 0:9
sapply(X, function(x) x %in% Y)
Code : Tout sélectionner
test <- data.frame(
mot = unlist(sapply(1:5, function(x) paste(letters[1:x], collapse = ""))))
test$mot_long <- nchar(as.character(test$mot))
Code : Tout sélectionner
test <- data.frame(
C = c("a", "aa", "b", "ab"))
length(grep("a", test$C))
Code : Tout sélectionner
layout(matrix(1:8, nrow = 1),
width = c(1, rep(2, 7)))
layout.show(n = 8)
Code : Tout sélectionner
plot(rnorm(100), xaxt = "n")
axis(side = 1, labels = NA)