n <- 20
tmp <- data.frame( stringsAsFactors=FALSE,
x=sample(letters, n, TRUE),
y=sample(LETTERS, n, TRUE),
za=rnorm(n),
zb=rnorm(n),
zc=rnorm(n)
)
stopifnot(
identical(
melt_(tmp, id.vars=c('x', 'y')),
melt_(tmp, measure.vars=c('za', 'zb', 'zc'))
)
)
Run the code above in your browser using DataLab