You are correct, passing in a text string works. Thanks for a great package
hadley wickham <h.wick...@gmail.com> Sent by: manipul...@googlegroups.com 04/07/09 10:32 AM Please respond to manipul...@googlegroups.com To ryan.shef...@malbecpartners.com cc manipul...@googlegroups.com, r-help@r-project.org Subject Re: Using as.formula() with the reshape package cast On Tue, Apr 7, 2009 at 8:44 AM, <ryan.shef...@malbecpartners.com> wrote: > > I am trying to use the "cast" function from the reshape package, where the > formula is not passed in directly, but as the result of the as.formula() > function. > > Using reshape v. 0.7.2 > > I am able to properly melt() by data with: > >> molten <- melt(x, id=1:2) > > then I can properly cast with this: > >> cast(molten, days ~ variable) > > but if I try > >> cast(molten, as.function("days ~ variable")) You're calling as.function ;) Also, I think you should be able to pass the string directly - reshape will convert it to a formula for you. Hadley -- http://had.co.nz/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "manipulatr" group. To post to this group, send email to manipul...@googlegroups.com To unsubscribe from this group, send email to manipulatr+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/manipulatr?hl=en -~----------~----~----~----~------~----~------~--~--- [[alternative HTML version deleted]] ______________________________________________ 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.