Re: [R] How to deal with a dataframe within a dataframe?

2012-05-09 Thread Robert Latest
On Tue, May 8, 2012 at 3:38 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: So this actually looks like something of a tricky one: if you wouldn't mind sending the result of dput(head(agg)) I can confirm, but here's my hunch: Hi Michael, while I'm trying to get my head around the

Re: [R] How to deal with a dataframe within a dataframe?

2012-05-09 Thread David Winsemius
On May 9, 2012, at 2:40 AM, Robert Latest wrote: On Tue, May 8, 2012 at 3:38 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: So this actually looks like something of a tricky one: if you wouldn't mind sending the result of dput(head(agg)) I can confirm, but here's my hunch: Hi

Re: [R] How to deal with a dataframe within a dataframe?

2012-05-09 Thread Gabor Grothendieck
On Tue, May 8, 2012 at 9:19 AM, Robert Latest boblat...@gmail.com wrote: Hello all, I am doing an aggregation where the aggregating function returns not a single numeric value but a vector of two elements using return(c(val1, val2)). I don't know how to access the individual columns of that

[R] How to deal with a dataframe within a dataframe?

2012-05-08 Thread Robert Latest
Hello all, I am doing an aggregation where the aggregating function returns not a single numeric value but a vector of two elements using return(c(val1, val2)). I don't know how to access the individual columns of that vector in the resulting dataframe though. How is this done correctly? Thanks,

Re: [R] How to deal with a dataframe within a dataframe?

2012-05-08 Thread R. Michael Weylandt
So this actually looks like something of a tricky one: if you wouldn't mind sending the result of dput(head(agg)) I can confirm, but here's my hunch: Try this: agg2 - aggregate(len ~ ., data = ToothGrowth, function(x) c(min(x), max(x))) print(agg2) str(agg2) You'll see that the third column is