Re: [R] 'apply' with additional class variable

2011-05-21 Thread Mark Ebbert
Thanks for the tip Josh! I thought about combining the data, but wondered if there was a way to pass in the information as a separate argument. But I went ahead with your solution and it worked perfectly. Thanks! On May 21, 2011, at 12:57 PM, Joshua Wiley wrote: > Hi Mark, > > Is there a reason

Re: [R] 'apply' with additional class variable

2011-05-21 Thread Joshua Wiley
Hi Mark, Is there a reason you cannot simply include the make of the car along with all the other data? Using your example: cbind(as.data.frame(t(x)), carmake) then instead of applying across columns, apply across rows, and have your custom function decide what to do based on the column named "

[R] 'apply' with additional class variable

2011-05-21 Thread Mark Ebbert
Dear R gurus, I'm trying to solve what I assume is a fairly simple problem, but I'm having trouble finding the proper approach. I have a matrix where each column is some object (e.g. a car) and each row is a numeric measurement of a feature of said object (e.g. horse power, top speed, etc.). Le