Whoa!
1. First and most important, there is very likely no reason you need
to do this. R can handle multiple groupings automatically in fitting
and plotting without creating artificial labels of the sort you appear
to want to create. Please read an "Intro to R" and/or get help to see
how.
2. The
How about this?
> indx <- unique(cbind(Dates, Groups))
> indx
DatesGroups
[1,] "12/10/2010" "A"
[2,] "12/10/2010" "B"
[3,] "13/10/2010" "A"
[4,] "13/10/2010" "B"
[5,] "13/10/2010" "C"
> indx <- data.frame(indx, id=1:nrow(indx))
> indx
Dates Groups id
1 12/10/2010
Dear Chandra,
You're on the wrong track. You don't need for loops as you can do this
vectorised.
as.numeric(interaction(data$Groups, data$Dates, drop = TRUE))
Best regards,
Thierry
> -Oorspronkelijk bericht-
> Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> N
3 matches
Mail list logo