Skip to content

plyr workaround to converting by() to a data frame

2 messages · Liviu Andronic, eric

#
Dear all
Is there a clean plyr version of the following by() and do.call(rbind,
...) construct:
Error in as.data.frame.default(dfsum) :
  cannot coerce class '"by"' into a data.frame
[,1] [,2]
[1,]    1   29
[2,]    2   30


Thank you
Liviu
#
Is this what you are looking for?

ddply ( .variables = c("grp1", "grp2", "grp3" ), .data = df, .fun = plyr::summarize, abmin = min(c(a, b, c) ), abmax = max ( c ( a, b, c)  ) )


----- Original message -----
From: "Liviu Andronic" <landronimirc at gmail.com>
To: "r-help at r-project.org Help" <r-help at r-project.org>
Date: Thu, 7 Apr 2011 18:39:30 +0200
Subject: [R] plyr workaround to converting by() to a data frame

Dear all
Is there a clean plyr version of the following by() and do.call(rbind,
...) construct:
Error in as.data.frame.default(dfsum) :
  cannot coerce class '"by"' into a data.frame
[,1] [,2]
[1,]    1   29
[2,]    2   30


Thank you
Liviu