Displaying 3 results from an estimated 3 matches for "ddube".
Did you mean:
dube
2009 Apr 13
3
tapply output as a dataframe
i use tapply and by often, but i always end up banging my head against
the wall with the output.
is there a simpler way to convert the output of the following tapply to
a dataframe or matrix than what i have here:
# setup data for tapply
dt = data.frame(bucket=rep(1:4,25),val=rnorm(100))
fn = function(x) {
ret =
c(unname(quantile(x,probs=seq(.25,.75,.25),na.rm=T)),mean(x,na.rm=T))
}
a =
2011 Feb 03
2
tapply output as a dataframe
On Mon, Apr 13, 2009 at 12:41 PM, Dan Dube <ddube-at-advisen.com> wrote:
> i use tapply and by often, but i always end up banging my head against
> the wall with the output.
The proposed solution of Dan's problem posted on R-help was:
> do.call(rbind,a)
When I use this 'solution' I get 'ERROR: second argument must...
2008 Jan 04
3
slow access to matrix dimnames
hello,
i have been trying to convert my data frames to matrices in the hopes of
speeding up some of my more complicated scripts.
to assist with this, i am trying to create a "matrix column operator"
like $:
"%$%" = function(data,field) {
as.numeric(data[,grep(field,unlist(dimnames(data)[2]))])
}
the idea here is that you can use a matrix like a dataframe: