On Thu, Jan 22, 2009 at 8:01 AM, Titus von der Malsburg <malsb...@gmail.com> wrote: > I have a data frame that is the result of a cast (reshape) operation. I > deleted the variable column and tried to melt the resulting data frame. > Depending on which method I use to delete the column I get different > error messages when melting: > > > head(tinfos) > vpn group trial_no item relation trial_type rt variable # > 1 102 2 1 4351 diag1 distractor 8471 fix_d 27 > 2 102 2 2 1214 id target 4072 fix_d 17 > 3 102 2 3 4213 diag1 distractor 7040 fix_d 27 > 4 102 2 4 1314 id target 4370 fix_d 15 > 5 102 2 5 2655 vert distractor 4397 fix_d 17 > 6 102 2 6 3322 horiz distractor 6132 fix_d 26 > > tinfos$variable <- NULL > > melt(tinfos) > Error: id variables not found in data: variable
Cast stores some extra information in the data frame that makes future melting a bit easier, provided that you don't delete any of the columns. Since you have, you need to throw away the extra info with: tinfos <- as.data.frame(tinfos) Regards, Hadley -- http://had.co.nz/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.