I have some data in a data frame in the following form:
A B C V1 V2 V3 1 1 1 x y z 1 1 2 a b c ...
Where A,B,C are facto
Using reshape2 package
reshape2
dat <- read.table(text = 'A B C V1 V2 V3 1 1 1 x y z 1 1 2 a b c',header= T) library(reshape2) melt(dat,id.vars = c('A','B','C')) A B C variable value 1 1 1 1 V1 x 2 1 1 2 V1 a 3 1 1 1 V2 y 4 1 1 2 V2 b 5 1 1 1 V3 z 6 1 1 2 V3 c