Dear R community,
I am trying to calculate a robust MANOVA in R, thus I have to restructure my data. In this regard, I have to create a new variable "row" that identifies the scores within each group. For 3 different groups of each 10 participants, it is advised to do it like this:
ocdData$row<-rep(1:10, 3)
#(Field, Miles, & Field, 2012)
In my case, I have 2 different groups with different group sizes 83 and 111 (row 1:83 and 84:194) am not sure how to deal with this to create the new "row" variable to restructure my data.
dfrobMan<-df [, c("E", "M", "mo", "S", "s", "Manipulation")]
dfrobMan$row<-rep(1:194, 1) #my problem that is not working (Group 2 values appear as NA after melt function)
dfMelt <-melt (dfrobMan, id = c("Manipulation", "row"), measured = c("M", "E", "S","mo" ,"s"))
´´´
Thanking you very much in advance for your support!